rsync with mode --delete

Budi Janto budijanto at studiokaraoke.co.id
Fri Jun 26 17:23:12 UTC 2020



On 6/23/20 12:37 PM, Francis.Montagnac at inria.fr wrote:
> If the rsync source path is /mnt/DATA yes, it will remove data on the
> client, but if the source path is a sub-directory of /mnt/DATA the
> rsync will fail without doing any deletion.
> 
> To verify in dry-run ... of course.
>
Thanks for first information. This is for more detail, which has already
been done.

Server side:
# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
pool  4.98T  9.07T  4.98T  /mnt/DATA

# cat /some/path/rsyncd.conf
[data]
comment = Storage area total approx size: 5.0 TiB (5341197216 KiB).
gid = nobody
list = yes
log file = /var/log/rsyncd.log
log format = %o %m %a %f %l (%b)
max connections = 20
path = /mnt/DATA
read only = true
reverse lookup = false
timeout = 300
transfer logging = yes
uid = nobody
use chroot = yes

Client side:
# crontab -l
0       */3   	*   	*   	*	/path/to/rsync.sh

# cat /path/to/rsync.sh
rsync -avPH --chmod=D755,F644 --delete rsync://xxx.xxx.xxx.xxx/data/

Any idea or suggestion to prevent client's data loss? Thank you.



-- 
Regards,


Budi Janto



More information about the rsync mailing list