我想使用sync_first
选项在我的服务器中仅创建每日备份。如何设置我的服务器以每天备份一次?
答案1
在/etc/rsnapshot.conf
集合中
snapshot_root /backup/rsnapshot/
# ...
sync_first 1
并将保留规则设置为仅限每日:
#retain hourly 6
retain daily 7
还/etc/cron.d/rsnapshot
定义每天仅启动 rsync 并添加同步选项:
#0 */4 * * * root /usr/bin/rsnapshot hourly
30 4 * * * root /opt/bin/rsnapshot sync && /usr/bin/rsnapshot daily
现在当使用详细选项调用 rsnapshot 时:
rsnapshot -v sync
rsnapshot -v daily
你会看到类似的输出
/bin/cp -al /backup/rsnapshot/.sync /backup/rsnapshot/daily.0
mv /backup/rsnapshot/daily.2/ /backup/rsnapshot/daily.3/
mv /backup/rsnapshot/daily.1/ /backup/rsnapshot/daily.2/
mv /backup/rsnapshot/daily.0/ /backup/rsnapshot/daily.1/
/bin/cp -al /backup/rsnapshot/.sync /backup/rsnapshot/daily.0