[密码]:备份通讯密码,小于8位。
[主机]:备份端主机IP。
1.备份端创建:/etc/rsyncd.conf
uid = rsync
gid = rsync
use chroot = no
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[backup]
path = /backup/
ignore errors
read only = no
auth users = rsync_backup
secrets file = /etc/rsync.password
2.备份端执行:
useradd rsync -s /sbin/nologin -M
mkdir /backup
chown -R rsync.rsync /backup/
echo "rsync_backup:[密码]" > /etc/rsync.password
chmod 600 /etc/rsync.password
rsync --daemon
3.备份端放行:端口873
4.备份端挂载:
rsync --daemon
5.网站端执行:
echo "rsync_backup:[密码]" > /etc/rsync.password
chmod 600 /etc/rsync.password
5.网站端挂载:
rsync -avz /www/wwwroot/wordpress rsync_backup@[主机]::backup --password-file=/etc/rsync.password