pg_back
pg_back copied to clipboard
Save weekly, monthly backups
In addition to the N previous backups, it would be nice to keep N' weekly backups and N'' monthly backups, to be able to look back into the far past.
Hi,
this looks interesting but quite difficult to implement because we do not have any control on how the runs are scheduled. Maybe a formulae like "keep 1 backup every N", N being 7 when scheduled daily? and so on for month
This would still have to be translate to a form easy to use in a command line option
Regards,
I would just specify:
If present, at least a backup is kept for each of the previous
purge_keep_monthly_backups
months, and each of the previouspurge_keep_weekly_backups
weeks.
Eg, if purge_keep_monthly_backups
= 2,
- when purging, do not purge the oldest of the backups younger than 2 months
- do not purge the oldest of the backups younger than 3 months
It can be tricky, because a 1 week old backup may be kept because of purge_older_than
>7 OR purge_keep_weekly_backups
>0 , and a 4 weeks old backup may be kept because purge_keep_weekly_backups
> 4 OR purge_keep_monthly_backups
>0.