Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Starting with release of raspiBackup an itelligent rotation strategy of your backups is supported. It's also called GFS (grandfather-father-son backup). raspiBackup retains following backups per default if a daily backup is created:

1) Backup of the current day and the last 6 days

2) Backup of the current week and the last 3 weeks

3) Backup of the current month  and the last 11 months

4) Backup of the current year

If weekly backups are created there will be no daily backups kept. Different retention values for daily, weekly, monthly and yearly can be defined with an option, e.g. if you want to retain weekly, monthly and yearly backups. Keep in mind the weekly backup day then will become the day of the weekly and monthly backup: If you configure Monday as the weekly backup day your monthly backup will be the first Monday of every month. Yout yearly backup will be the first Monday of the year. Iy you create a weekly backup every Sunday the monthly backup will be the first Sunday of the month and the yearly backup will be the first Sunday of the year.


Note: If there are multiple daily backups the latest backup will be retained. Weekly, monthy or yearly backups will use the latest backup. If there exist two daily backups from 10:00 AM and 11:00 PM the backup from 11 AM will be retained. If there exist daily backups from Monday, and Friday the backup from Monday will be retained. If there exist backups on 1., 10. and 30. of a month the backup from 1. will be retained. if you create daily backups every weekly backup will start Monday, every monthls backup will be the 1. backup of a month and yearly backups will be the backup of the 1. January of the year.

smart recycle strategy

(Kudos for Hofei who created the initial German version)


Smart recycle backup strategiy example - Backupdirectory (daily backup, Defaultoptions: 7/4/12/1)

(Backup run on 2019/11/19)

20191117 1. daily backup
20191116 2. daily backup
20191115 3. daily backup
20191114 4. daily backup
20191113 5. daily backup
20191112 6. daily backup
20191111 7. daily and 1. weekly backup
20191101 1. monthly backup
20191104 2. weekly backup
20191001 2. monthly backup
20191028 3. weekly backup
20191021 4. weekly backup
20190901 3. monthly backup
20190801 4. monthly backup
20190701 5. monthly backup
20190601 6. monthly backup
20190501 7. monthly backup
20190401 8. monthly backup
20190301 9. monthly backup
20190201 10. monthly backup
20190101 11. monthly backup and 1. yearly backup
20181201 12. monthly backup

Smart recylce backup strategy - Options

You enable the smart recycle backup strategy with option --smartRecycle. Option --smartRecycleOptionscan be used to change the default retention sizes. Default is option--smartRecycleOptions "7 4 12 1". --smartRecycleOptions "0 4 12 1" will retain for example the last 4 weekly and the last 12 montly backups.

Important note: As long as you don't turn offf --smarteRecycleDryrun raspiBackup only writes messages explaining which backups would be deleted and which would be retained. That way you can check whether the result maps to what you expect and will not delete old backups by accident which you want to keep. That's important to check when you already have a backup history and start using the smart recycle backup strategy and don't use a new backup directory. If you are sure the smart recycle backup strategy retains the correct backups disable the dryrun with option --smarteRecycleDryrun-and then in every backup run the smart recycle backup strategy will be applied and all backups not needed any more will be deleted. As an alternative you can use config option DEFAULT_SMART_RECYCLE_DRYRUN=0to disable the dry run.


Add comment


Every comment is reviewed manually because of spam and usually it may take up to one day until you comment will be published.
In order to reduce spam posts which pass reCAPTCHA you have to wait for at least 15 minutes until you can post a new comment. In addition a comment with string http is rejected immediately.
Sorry for the inconvenience.