-
Notifications
You must be signed in to change notification settings - Fork 35
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
The --daily
option inexplicably(?) deletes yesterday's backup unless -p
is also given
#8
Comments
I think this behavior is actually normal. As I understand it, rotate-backup expects one folder to be filled with only one type of backup. It will evaluate all the files present in this folder and run the algorithm on all of them, no matter the filename. I see 2 solutions for your problem : First one would be to put your backups in 2 differents folders :
And put 2 differents call to rotate-backups in your crontab :
If you want to keep both backup types in the same folder, the other solution would be to use something like :
But this solution seems to be buggy, as you may have seen in the issue I opened : #7 |
I thought about that, but it's not obvious from the documentation. I'll fix that in a PR if I could get confirmation from @xolox that this is, indeed, the intended behavior. But anyway, why would |
Hi Kevin and thanks for the feedback. Reading through #7 and #8 made me realize that the available documentation was insufficient, causing backups to be rotated when users aren't expecting it, without a good explanation why. I've tried to improve this now:
I'm going to close this issue now because everything was working as intended, but that wasn't clear from the documentation, which should be much better now. |
@xolox Super, thanks for being receptive to feedback from your users. Extra stars in my book. |
I read through the other issues (again), but I'm seeing daily backups deleted right before my eyes with the
--daily=
switch, and I'm still not sure if this is the intended behavior.The gist of the problem is
--daily=n
(n > 1) without--prefer-recent
seems to delete backups that occurred within the last 24 hours, which never allows enough of them to stick around for weekly, yearly, or monthly backups to be retained.Here's the setup:
CentOS 6, Python 2.7.something (from the RedHat SCL),
rotate-backups
version 4.4a nightly cron job which invokes
rotate-backups
(at 12:39 am, if that matters) with these options(where those variables have values of 7, 4, 6, and 2, respectively)
the cron job runs
rotate-backup
before creating atar.bz2
backup of some files, and a.sql.gz
database dump, both of which get a timestamp that looks like(i.e., ISO 8601 format)
the
tar.bz2
files seem to be properly rotated, but thesql.gz
one is just deleted every night, so when I go check onrotate-backups
's handiwork, there's just the one that finished at around 1 am, and no others.I'm not sore about the files being deleted (there are ample warnings in the documentation about using
--dry-run
), but I'm puzzled by this behavior.Here are two invocations of
rotate-backups
with the same options, except the second one adds--prefer-recent
:versus
Why does it seem to be working fine for the
.tar.bz
files?Is this totally sensible behavior and my brain just can't grasp how the default algorithm works? Or is this errant behavior introduced recently, by a recent PR or something? I feel like the current behavior is contrary to the usual connotation of "daily backups" or "keep 7 days of daily backups."
The text was updated successfully, but these errors were encountered: