pyxbackup icon indicating copy to clipboard operation
pyxbackup copied to clipboard

Retention of old backups

Open nbokkisam opened this issue 7 years ago • 3 comments

I know the config allows no of days to retain daily backups. There are parameters for weekly, monthly and I believe the weekly, monthly backup options are not developed yet(According to config file comments).

Is it possible to offer retention of old backups based on grandfather-father-son schedule( https://en.wikipedia.org/wiki/Backup_rotation_scheme#Grandfather-father-son)? You can refer to this repository where similar functionality is implemented using PHP. https://github.com/ianneub/php_backup_s3

Something like below Everyday for the past two weeks (14 backups) Every Saturday for the past 2 months (8 or 9 backups) First day of the month going back forever

Thanks.

nbokkisam avatar Jan 21 '18 18:01 nbokkisam

@nbokkisam The code is actually there, beta quality I suppose and needs some real world testing. In brief this is how it works.

  • Take backups daily
  • On sunday, rotates the oldest backup as weekly
  • On the same Sunday, if oldest backup was taken on the last week of the month, it is also rotated to monthly.

Monthly backups are not based on absolute dates.

Please test and let me know if you encounter problems. I know I need some unit tests on these, but bug reports help prioritize any major issues.

dotmanila avatar Jan 23 '18 17:01 dotmanila

@dotmanila Thanks for the reply. I can help you testing. Can you please let me know the config values I should maintain for testing weekly & monthly backups archiving. Thank You for this great tool.

How many sets of full + incrementals to keep in stor

retention_sets = 2

How many archived weekly backups are kept, unused for now

retention_weeks = 0

How many archived monthly backups are kept, unused for now

retention_months = 0

nbokkisam avatar Jan 23 '18 18:01 nbokkisam

@nbokkisam

retention_sets is how many backup sets you want to keep. If you have full + incremental, how many of these combinations you want to retain.

retention weeks, how many backups you want to keep that is taken on Sundays. If the Sunday backup is incremental, it will include its full backup as well. I suggest begin with 2.

Same for retention months - if you want to backups every 4 weeks going back to forever, you may want to set this to a very high number i.e. 99999

dotmanila avatar Jan 23 '18 18:01 dotmanila