rsync with mode --delete

Wayne Davison wayne at opencoder.net
Fri Jun 26 22:01:23 UTC 2020


On Fri, Jun 26, 2020 at 10:24 AM Budi Janto wrote:

> path = /mnt/DATA
> Any idea or suggestion to prevent client's data loss?
>

There are several options:

   1. Set the "pre-xfer exec = /script/name" in your daemon module and make
   the script check if a /mnt/DATA/known-to-exist-subdir is missing and if so,
   do an "exit 1".
   2. If your server rsync is at least 3.2.1, set the "early exec =
   /script/name" in your daemon module and make the script verify that the
   drive is mounted & attempt to mount it if it is not (return an error code
   if unable to mount it).  The mount action is not possible in the pre-xfer
   exec script because rsync has already done a chdir to the empty mount by
   the time this script runs.
   3. Move everything down into a deeper directory and tweak the path in
   your daemon module to be "path = /mnt/DATA/subdir" so that the transfer
   will fail when the mount is not there (because the subdir is not there).

..wayne..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20200626/ae856f2e/attachment.htm>


More information about the rsync mailing list