Bug 2881 - delete-exclude
Summary: delete-exclude
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.5
Hardware: All Linux
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2005-07-15 13:43 UTC by mario
Modified: 2006-03-12 02:59 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description mario 2005-07-15 13:43:24 UTC
Add an exclude parameter for a directory that should not be affected with
--delete[-before|-after] .

For example I want to transfer/update a complete root system but don't want to
delete running process info in /var on the remote system. Then I would do
something like rsync .... --delete-after --delete-exclude=/var ...
Comment 1 Wayne Davison 2005-07-15 14:20:37 UTC
I assume you don't want to do this:


... which would both prevent any copying from /var and prevent any deleting in
var.  If so, do this:

--filter='protect /var'       OR       -f 'P /var'

That tells the receiving side that all files in the /var hierarchy should be
protected from being deleted (assuming that you're transferring from /).  You
might want to change that to be more specific, though, such as protecting
/var/run and /var/lock, but that's up to you.

Note that the --filter option was added in 2.6.4, so if you're pulling, the
receiving side needs to be at least 2.6.4, and if you're pushing, both sides
need to be at least 2.6.4.