Retention Policy keeps wrong daily backup?
malavolti opened this issue · comments
Describe the bug
I'm using TZ=Europe/Rome and the following Backrestic plan:
{
"id": "immich-data",
"repo": "restic-backup",
"paths": [
"/immich-data"
],
"excludes": [],
"iexcludes": [],
"retention": {
"policyTimeBucketed": {
"yearly": 1,
"monthly": 6,
"weekly": 4,
"daily": 7,
"hourly": 24
}
},
"schedule": {
"cron": "0 * * * *"
}
}
But the "daily" backup saved is not the last one (23:00), but the second (01:00) of the day.
Expected behavior
I desire to keep the last daily backup, not the second one.
Platform Info
- OS and Architecture: Debian 12 [x86_64]
- Backrest Version: v1.1.0
Hmm. Strange. This must be behavior coming from how restic implements forget policies: https://restic.readthedocs.io/en/latest/060_forget.html which I agree can be a bit counter intuitive.
Looking at restic/restic#3722 and restic/restic#2233 these could possibly be related? But I'm seeing that the local timezone should be picked up / stored in the snapshot so this may not be a problem for backrest. Deserves more investigation.
I'm likely going to close this as won't fix infeasible. It may be something to check with the restic forum about, I suspect this is the intended restic behavior though it might not be intuitive. It's probably not something backrest should try to change.