|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
filtered --delete ?Is there any way of filtering which files --delete removes? ...something like a --delete-exclude=FILTER option or something equivalent? I want to do an rsync on multiple directories, however I only want one of these directories to have files deleted, or I only want certain specific files deleted, not all of them - is this possible? -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html |
|
|
Re: filtered --delete ?On Monday 23 June 2008 11:55:59 pm Matt McCutchen wrote:
> On Mon, 2008-06-23 at 15:05 +0000, Corey wrote: > > Is there any way of filtering which files --delete removes? > > > > ...something like a --delete-exclude=FILTER option or something > > equivalent? > > This is exactly what "protect" filters (--filter='P pattern') do. > Ah - nice, I had overlooked that while perusing the man page; too much in a hurry for my own good! > Actually, by default, a plain exclude like --exclude=pattern or > --filter='- pattern' both "hides" matching source files from the file > list and "protects" matching destination files from deletion. With > --delete-excluded, plain excludes only hide and you have to use > --filter='P pattern' to protect. > > > I want to do an rsync on multiple directories, however I only want one of > > these directories to have files deleted, or I only want certain specific > > files deleted, not all of them - is this possible? > > Do something like --filter='R /delete/in/D/*' --filter='P *'. The "R" > is for "risk", the opposite of "protect". Files in directory D will > match the first filter and be considered for deletion, while all other > files will match the second and be protected from deletion. > Excellent; thanks a ton - that's exactly what I was looking for. Kind regards! -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html |
|
|
Re: filtered --delete ?On Mon, 2008-06-23 at 15:05 +0000, Corey wrote:
> Is there any way of filtering which files --delete removes? > > ...something like a --delete-exclude=FILTER option or something equivalent? This is exactly what "protect" filters (--filter='P pattern') do. Actually, by default, a plain exclude like --exclude=pattern or --filter='- pattern' both "hides" matching source files from the file list and "protects" matching destination files from deletion. With --delete-excluded, plain excludes only hide and you have to use --filter='P pattern' to protect. > I want to do an rsync on multiple directories, however I only want one of > these directories to have files deleted, or I only want certain specific > files deleted, not all of them - is this possible? Do something like --filter='R /delete/in/D/*' --filter='P *'. The "R" is for "risk", the opposite of "protect". Files in directory D will match the first filter and be considered for deletion, while all other files will match the second and be protected from deletion. Matt -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html |
| Free Forum Powered by Nabble | Forum Help |