7.1.5. Example of a Weekly Full Backup Followed by Daily Incremental Backups
A Weekly Full Backup Followed by Daily Incremental Backups
The script makes a full backup on a Sunday and incremental backups of the following days. Each day that a backup is made, a new subdirectory is created. This script requires a daily cron job.
so
if [[ $(date +%w) == 0 ]]; then
should be
if [[ $(date +%w) == 7 ]]; then
Responses
Hi Simeon,
Thank you for sharing this interesting and useful solution. It would be nice if you could edit your post and add more information.
Especially what gets backed up and to which location - what are the steps ... eventually providing an example would be helpful. :)
Regards,
Christian
For the command, I have opened documentation bug: https://bugzilla.redhat.com/show_bug.cgi?id=1641768 and will fix this shortly.
- LAST=$(ls -td -- $DESTINATION/*/ | head -n 1)^ On testing, this works for us.
It seems that you want to create each incremental backup directly from the full backup so the condition from your script can be met only on Monday with that assumption.
Your script has a different approach that less effective on space but easier to restore because you just need the full backup and the increment that you need to revert. In the scripts in the docs, you also need all the increments in between. However, the script in the docs is working on testing.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
