Selective --delete

Ashley M. Kirchner ashley at pcraft.com
Tue Jan 7 09:19:25 MST 2014


I have two servers which I will refer to as a LIVE and DEV servers.  On the
LIVE server, I have a script that executes the following rsync command:

rsync --links --verbose --progress --archive \
  --exclude="=imagebase=" --exclude="events" \
  --delete \
  rsync://rsyncuser@DEV.domain.com/path/on/DEV /path/on/LIVE/

My issue is with the --delete part.  While I want the procedure to delete
extraneous files from the LIVE server when they are removed from the DEV
one, there are a few files on LIVE that do not and will never exist on the
DEV server, however they are required on the LIVE one.  Is there a way to
have rsync NOT delete those?  Is there an equivalent exclude option for the
--delete procedure so that it would still delete whatever got removed from
the DEV machine, but it leaves those files I tell it to ignore?  I have
both individual files as well as entire paths that would need to be spared
from getting unceremoniously deleted ... while others do need to get pruned
if necessary (because they no longer exist on the DEV one.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20140107/2fe0a822/attachment.html>


More information about the rsync mailing list