rsync : how to exclude specific files or folders ?

H.S. hs.samix at gmail.com
Sun Mar 1 02:19:21 UTC 2009


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
in any path. See first rule in section EXCLUDE PATTERNS in rsync man page.

Regards.




-- 

Please reply to this list only. I read this list on its corresponding
newsgroup on gmane.org. 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