LINUX rsync-demo

#!/bin/sh

inotifywait -mrq --timefmt '%d/%m/%y %H:%M' --format '%T %w%f' -e modify,delete,create,attrib /www/rsync-demo/ | while read file
do
rsync -avPz -e 'ssh -p 528' --progress /www/rsync-demo/ 43.129.245.90:/www/rsync-demo/
rsync -avPz -e 'ssh -p 528' --delete /www/rsync-demo/ 43.129.245.90:/www/rsync-demo/
echo "${file} was synchronized"
done

 

posted on 2022-01-05 15:37  Ben丶大壮  阅读(31)  评论(0编辑  收藏  举报

导航