Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running the following rsync command

rsync --times -v --recursive --compress --exclude "*.svn" --rsh=/usr/bin/ssh source/folder/ user@ip:httpdocs/

which excludes *.svn files when running. My question is how do I pass it a list of file types to exclude. There are a lot of non-essential hidden files in our development copy (IDE project files and osx specific files)

I need to pass in a list of 5 or 6 file extensions for rsync to ignore.

thanks

share|improve this question
add comment

1 Answer

Use the --exclude-from option, and specify a text file with all the patterns you want to avoid in it, like:

rsync --times -v --recursive --compress --exclude-from /tmp/filelist.txt --rsh=/usr/bin/ssh source/folder/ user@ip:httpdocs/
share|improve this answer
3  
Or you can specify the --exclude option multiple times. –  womble Nov 27 '09 at 9:19
    
Great thanks, do I just put the file types each on a new line in /tmp/filelist.txt ? –  neilc Nov 27 '09 at 9:26
    
I like it when my command lines span both my monitors :) –  RainyRat Nov 27 '09 at 9:27
    
...and yes, each pattern on a new line. –  RainyRat Nov 27 '09 at 9:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.