Bug 2881 - delete-exclude
delete-exclude
Status: CLOSED WORKSFORME
Product: rsync
Classification: Unclassified
Component: core
2.6.5
All Linux
: P3 enhancement
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-15 13:43 UTC by mario
Modified: 2006-03-12 02:59 UTC (History)
0 users

See Also:


Attachments

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:

--exclude=/var

... 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.