2

I want to create only daily backups in my server using sync_first option. How do I have to setup my server to backup once a day?

rubo77
  • 2,469
  • 4
  • 34
  • 66

1 Answers1

1

In /etc/rsnapshot.conf set

snapshot_root   /backup/rsnapshot/
# ...
sync_first      1

and the retain rules to only daily:

#retain         hourly  6
retain          daily   7

In /etc/cron.d/rsnapshot also define to start rsync only daily and add the sync option:

#0 */4          * * *           root    /usr/bin/rsnapshot hourly
30 4    * * *           root    /opt/bin/rsnapshot sync && /usr/bin/rsnapshot daily

Now when calling rsnapshot with verbose option:

rsnapshot -v sync
rsnapshot -v daily

you see an output like

/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
rubo77
  • 2,469
  • 4
  • 34
  • 66
  • Thanks for highlighting the '-v' option. Was having trouble understanding as to why 'at least one backup point must be set' for rotation only. It just needs to be present in the config file, but is never used.. Just for clarification: this scenario can occur, if you use several config files because of several origins having different ssh port configs. and then you want to be sure what happens when rotating to daily on one of the configs .. – Andre9br Jan 05 '17 at 10:17