yum install rsnapshot
ssh-keygen
ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.1.148
vi /etc/rsnapshot.conf
config_version 1.2
snapshot_root /.snapshotcmd_cp /usr/bin/cpcmd_rm /usr/bin/rmcmd_rsync /usr/bin/rsynccmd_ssh /usr/bin/sshcmd_logger /usr/bin/loggercmd_du /usr/bin/duinterval hourly 6interval daily 7interval weekly 4verbose 2loglevel 3logfile /var/log/rsnapshotlockfile /var/run/rsnapshot.pidssh_args -p 22backup root@192.168.1.148:/home/ example.com/ +rsync_long_args=--bwlimit=16,exclude=core
rsnapshot configtest
rsnapshot -t hourly
rsnapshot hourly
备份成功》》》》
实现自动化备份
crontab -e
- 0 */4 * * * root /usr/bin/rsnapshot hourly
- 30 3 * * * root /usr/bin/rsnapshot daily
- 0 3 * * 1 root /usr/bin/rsnapshot weekly
- 30 2 1 * * root /usr/bin/rsnapshot monthly