rsync : how to exclude specific files or folders ?

H.S. hs.samix at
Mon Mar 2 00:56:14 UTC 2009

H.S. wrote:
> Matthew Flaschen wrote:
>> Vincent Trouilliez wrote:
>>> Oh ! After reading your mail, and re-re-re-reading the man page, I ventured into this:
>>> $rsync <options> --exclude '*.VirtualBox' --exclude '*.googleearth' <source> <destination>
>>> and it worked !
>> Yes, and if you want to switch from a chain of exclude parameters to a
>> file (e.g. if the command line starts getting long), you can just do:
>> rsync <options> --exclude-from=my_exclude_file <source> <destination>
>> And my_exclude_file is then just:
>> *.VirtualBox
>> *.googleearth
> The asterisks are needed. ".foo" will match a file any file called .foo

I had meant to write they are *not* needed to match all such named
files. Sorry for the omission.


Please reply to this list only. I read this list on its corresponding
newsgroup on Replies sent to my email address are just
filtered to a folder in my mailbox and get periodically deleted without
ever having been read.

More information about the ubuntu-users mailing list