rsync同步指定文件
定时任务
*/5 * * * * cd /home/ops/prometheus-2.3.0.linux-amd64/;rsync -artz -R --delete --timeout=180 ./ --include="prometheus.yml" --exclude="*" vmagent@1.2.32.19::vmagent --password-file=/etc/rsyncd.passwd
[root@sf-01 vmagent]# cat /etc/rsyncd.conf
uid = root
gid = root
use chroot = no
max connections = 200
timeout = 300
strict modes = false
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[vmagent]
path = /home/ops/victoria-metrics/vmagent/
ignore errors
read only=no
write only=no
hosts allow = *
hosts deny = 127.0.0.1
auth users = vmagent
secrets file = /etc/rsync.password