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

Bug: hourly=0 preserves one hourly backup #34

Open
jan-brinkmann opened this issue Jan 13, 2022 · 0 comments
Open

Bug: hourly=0 preserves one hourly backup #34

jan-brinkmann opened this issue Jan 13, 2022 · 0 comments

Comments

@jan-brinkmann
Copy link

Cheers,

this is a bug report:

Expected Behavior
When one runs rotate-backups with flag hourly=0, all hourly backups will be removed.

Observed Behavior
When one runs rotate-backups with flag hourly=0, one hourly backup will be preserved. As you can see from the log below, this missbehavior does not occur for daily=0.

rotate-backups --hourly=0 --daily=0 --weekly=4 --monthly=12 --yearly=always --dry-run /archive
sh: --daily=0: unknown operand
INFO Performing a dry run (because of --dry-run option) ..
INFO Scanning /archive for backups ..
INFO Found 20 timestamped backups in /archive.
INFO Preserving /archive/backup-2021-08-11T21-30-33.tar.gz (matches 'monthly' and 'yearly' retention periods) ..
INFO Preserving /archive/backup-2021-10-16T21-20-05.tar.gz (matches 'monthly' retention period) ..
INFO Preserving /archive/backup-2021-11-01T03-00-07.tar.gz (matches 'monthly' retention period) ..
INFO Preserving /archive/backup-2021-12-01T03-00-07.tar.gz (matches 'monthly' retention period) ..
INFO Deleting /archive/backup-2021-12-20T03-00-07.tar.gz ..
INFO Preserving /archive/backup-2021-12-27T03-00-08.tar.gz (matches 'weekly' retention period) ..
INFO Preserving /archive/backup-2022-01-01T12-00-08.tar.gz (matches 'weekly', 'monthly' and 'yearly' retention periods) ..
INFO Deleting /archive/backup-2022-01-01T16-00-07.tar.gz ..
INFO Preserving /archive/backup-2022-01-03T03-00-07.tar.gz (matches 'weekly' retention period) ..
INFO Deleting /archive/backup-2022-01-04T03-00-08.tar.gz ..
INFO Deleting /archive/backup-2022-01-05T00-00-07.tar.gz ..
INFO Deleting /archive/backup-2022-01-06T00-00-07.tar.gz ..
INFO Deleting /archive/backup-2022-01-07T00-00-07.tar.gz ..
INFO Deleting /archive/backup-2022-01-08T03-00-07.tar.gz ..
INFO Deleting /archive/backup-2022-01-09T03-00-07.tar.gz ..
INFO Preserving /archive/backup-2022-01-10T00-00-07.tar.gz (matches 'weekly' retention period) ..
INFO Deleting /archive/backup-2022-01-11T00-00-08.tar.gz ..
INFO Deleting /archive/backup-2022-01-12T00-00-08.tar.gz ..
INFO Deleting /archive/backup-2022-01-13T00-00-08.tar.gz ..
INFO Preserving /archive/backup-2022-01-13T09-01-49.tar.gz (matches 'hourly' retention period) ..

Interestingly, the script echos sh: --daily=0: unknown operand.

Further, if hourly=-1, all hourly backups will be removed:

rotate-backups --hourly=-1 --daily=0 --weekly=4 --monthly=12 --yearly=always --dry-run /archive
INFO Performing a dry run (because of --dry-run option) ..
INFO Scanning /archive for backups ..
INFO Found 20 timestamped backups in /archive.
INFO Preserving /archive/backup-2021-08-11T21-30-33.tar.gz (matches 'monthly' and 'yearly' retention periods) ..
INFO Preserving /archive/backup-2021-10-16T21-20-05.tar.gz (matches 'monthly' retention period) ..
INFO Preserving /archive/backup-2021-11-01T03-00-07.tar.gz (matches 'monthly' retention period) ..
INFO Preserving /archive/backup-2021-12-01T03-00-07.tar.gz (matches 'monthly' retention period) ..
INFO Deleting /archive/backup-2021-12-20T03-00-07.tar.gz ..
INFO Preserving /archive/backup-2021-12-27T03-00-08.tar.gz (matches 'weekly' retention period) ..
INFO Preserving /archive/backup-2022-01-01T12-00-08.tar.gz (matches 'weekly', 'monthly' and 'yearly' retention periods) ..
INFO Deleting /archive/backup-2022-01-01T16-00-07.tar.gz ..
INFO Preserving /archive/backup-2022-01-03T03-00-07.tar.gz (matches 'weekly' retention period) ..
INFO Deleting /archive/backup-2022-01-04T03-00-08.tar.gz ..
INFO Deleting /archive/backup-2022-01-05T00-00-07.tar.gz ..
INFO Deleting /archive/backup-2022-01-06T00-00-07.tar.gz ..
INFO Deleting /archive/backup-2022-01-07T00-00-07.tar.gz ..
INFO Deleting /archive/backup-2022-01-08T03-00-07.tar.gz ..
INFO Deleting /archive/backup-2022-01-09T03-00-07.tar.gz ..
INFO Preserving /archive/backup-2022-01-10T00-00-07.tar.gz (matches 'weekly' retention period) ..
INFO Deleting /archive/backup-2022-01-11T00-00-08.tar.gz ..
INFO Deleting /archive/backup-2022-01-12T00-00-08.tar.gz ..
INFO Deleting /archive/backup-2022-01-13T00-00-08.tar.gz ..
INFO Deleting /archive/backup-2022-01-13T09-01-49.tar.gz ..

Regards,
Jan

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

1 participant