server feature request. forced backup

Wayne Davison wayned at samba.org
Thu Jan 12 19:33:55 GMT 2006


On Thu, Jan 12, 2006 at 01:26:32PM +0100, Paco Rosich wrote:
> Seems to me that this could be done with a new server option
> (--forced-options???) to force the --backup thing to be done, so the
> rsync server never completely destroys any data it has stored.

This is possible using the latest CVS source using the "pre-exfer exec"
server option with a custom script/command.  You would make the script
examine the RSYNC_ARG# values (e.g. RSYNC_ARG1) and verify that the 'b'
option was included in the short-option letters, that the --backup-dir
option was present, and that the arg right after --backup-dir was the
expected directory string.  If they were not, it would simply need to
exit with an error status and rsync would abort the transfer.

As an example, these RSYNC_ARG# variables might be present:

SYNC_ARG0=rsyncd
RSYNC_ARG1=--server
RSYNC_ARG2=--sender
RSYNC_ARG3=-vblogDtpr
RSYNC_ARG4=--list-only
RSYNC_ARG5=--backup-dir
RSYNC_ARG6=/backup/here
RSYNC_ARG7=.

Note that $RSYNC_ARG3 contains the 'b' (--backup) option.

..wayne..


More information about the rsync mailing list