Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserving the most recent backups #5

Closed
tonyo opened this issue Aug 3, 2016 · 2 comments
Closed

Preserving the most recent backups #5

tonyo opened this issue Aug 3, 2016 · 2 comments

Comments

@tonyo
Copy link

tonyo commented Aug 3, 2016

Let's assume that I have two backups:

backup-2016-01-10_21-15-00.tar.gz
backup-2016-01-10_21-45-00.tar.gz

Then I do:

$ rotate-backups --hourly=1 --dry-run dir/ 
2016-08-03 12:44:41 tonyhost rotate_backups.cli[6556] INFO Performing a dry run (because of --dry-run option) ..
2016-08-03 12:44:41 tonyhost rotate_backups[6556] INFO Scanning /home/tonyo/tmp/backup_rotate/dir for backups ..
2016-08-03 12:44:41 tonyhost rotate_backups[6556] INFO Found 2 timestamped backups in /home/tonyo/tmp/backup_rotate/dir.
2016-08-03 12:44:41 tonyhost rotate_backups[6556] INFO Preserving ~/tmp/backup_rotate/dir/backup-2016-01-10_21-15-00.tar.gz (matches 'hourly' retention period) ..
2016-08-03 12:44:41 tonyhost rotate_backups[6556] INFO Deleting ~/tmp/backup_rotate/dir/backup-2016-01-10_21-45-00.tar.gz ..

So rotate-backups removes the second, more recent backup (..._21-45-...). Could you please clarify why we don't want to keep the most recent one, and remove the one made at 21:15?
Does it make sense to add some option (like --keep-recent) to change this behaviour and keep the latest backups?

As a general (and somehow related) question, is it planned to introduce a minutely option to enable rotation if backups are made several times per hour?

@xolox
Copy link
Owner

xolox commented Aug 4, 2016

Hi Anton and thanks for the feedback.

Could you please clarify why we don't want to keep the most recent one, and remove the one made at 21:15?

I guess it's just a preference :-). When I originally developed rotate-backups I made the decision to preserve the first (oldest) backup in each time slot. For my use cases I don't consider it relevant to prefer more recent backups over less recent backups because my focus is on long term archival (versus e.g. disaster recovery).

Does it make sense to add some option (like --keep-recent) to change this behaviour and keep the latest backups?

I just released version 4.1 which adds support for the -p, --prefer-recent command line option. I've also updated the documentation to explain what the default rotation algorithm is and how to change it.

As a general (and somehow related) question, is it planned to introduce a minutely option to enable rotation if backups are made several times per hour?

I just released version 4.2 which adds support for the -M, --minutely command line option :-).

Hope this helps!

@xolox xolox closed this as completed Aug 4, 2016
@tonyo
Copy link
Author

tonyo commented Aug 5, 2016

@xolox Amazing, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants