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?

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
1
  • 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 5 '17 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.