Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question

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
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

Your Answer


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