Excluding two subdirectories in rsync

Bill Davidsen davidsen at tmr.com
Tue Aug 25 17:47:17 UTC 2009


Christopher K. Johnson wrote:
> Robert Moskowitz wrote:
>> I have been using an rsync for Centos updates like:
>>
>> rsync -auv rsync://mirrors..../updates/i386/ --delete --exclude=debug/ 
>> /repos/centos/updates/i386
>>
>>
>> But for Fedora 11, I see there is a drpms subdirectory that I ASSuME I 
>> don't need, drpms.
>>
>> How do I exclude two subdirectories?  I can't figure it out from the 
>> man pages.
>>
>> --exclude="debug/ drpms/"   ???
>>
>>
> Add another --exclude instead.
> rsync -auv rsync://mirrors..../updates/i386/ --delete --exclude=debug/ 
> --exclude=drpms/ /repos/centos/updates/i386
> 
Let me say that Anne has showed how to use a skiplist, and that's the better 
way. After that I'll note that this is where you might find shell brace-comma 
notation saves a lot of typing and keeps lines in scripts reasonable:
   rsync -auv ~ --exclude={*~,[Cc]ache/} bkup.my.domain:/bkup/$(hostname)

More useful in a one time manually typed command, obviously.

-- 
Bill Davidsen <davidsen at tmr.com>
   "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot




More information about the users mailing list