How to prevent deletion of files on the client side?

Wayne Davison wayned at samba.org
Wed Jun 15 15:58:40 GMT 2005


On Wed, Jun 15, 2005 at 10:18:31AM -0400, M?tras Pierre wrote:
> I suspect that the passphrase file is not transmitted in the files
> list to the client, as it is excluded on the server. But the --delete
> on the client side removes it. [...] To keep it on the mirror, I have
> to exclude it again on the client side.

See the rsyncd.conf manpage in the section on the "exclude" config
option for an explanation of why this is necessary:

    http://rsync.samba.org/ftp/rsync/rsyncd.conf.html

> Is it possible to keep only one list of exclusion on the server side
> or share it from both sides, and benefit from the --delete option to
> remove files only in the directories transfered?

You could just maintain the list on the receiving side only -- if you
only have one client pulling information, that is the easiest place to
maintain the list of exclusions.

Another possibility is to install 2.6.5 on both hosts and then switch
over to using --delete-after and the -F option to have rsync use per-
directory filter files (each named .rsync-filter) to limit the transfer
and the deletions.  Either exclude everything in one file in the root of
the transfer, or sprinkle .rsync-filter files around in the dirs where
you want to exclude something (possibly anchoring the exclude rules so
that they apply only to the current directory).  See the rsync manpage
in the FILTER RULES section for the rule format for the .rsync-filter
files (since filter rules aren't the same as includes/excludes, though
there is some similarity in the include and exclude rules):

    http://rsync.samba.org/ftp/rsync/rsync.html

..wayne..


More information about the rsync mailing list