Replies: 3 comments 1 reply
-
We often get reports that prune was "not working as I think it should", but usually it is because the reporter's expectation does not match our implementation/documentation. So, please first read the docs and then specifically report any difference you find to the documented behaviour, if any. I guess your main misunderstanding is that But you invoked |
Beta Was this translation helpful? Give feedback.
-
I think I have a better idea after I re-read and emphasized this line:
The "days without backups do not count" was the important bit. I had assumed "--keep-daily" meant calendar days regardless of backup runs, i.e. "for the last 30 days delete all but one backup on each (calendar) day, if there is a backup that day". I don't think it's a crazy assumption especially for someone that's been using various backup software going back to "tar" on mainframes in the early 1980's. Personal opinion: The parenthetical bit "(days without backups do not count)" feels a bit too important to just be that. While I see the examples with new context after grokking that, clear explanation that the documentation and examples assume a daily/hourly/etc. backup schedule probably would have saved some confusion. I also still need to figure out if there's a way to accomplish the goal of "keep 1 backup each day if one exists but only within the last N days" while also having other rules around weeks, months, and years also apply without negating each other or manually maintaining backup histories. Maybe the new understanding of the prune options will help. |
Beta Was this translation helpful? Give feedback.
-
Thank you, understood now. However, the option is literally named "--keep-daily", as in dictionary "daily". If the sentence "We do not assume a daily/hourly/etc. backup schedule" started the Examples section it would have made the whole section a lot clearer initially. The docs also state:
I hope you can see how one may initially assume daily backups when that sentence says to assume today's backup has not yet been made. With the word "daily" being so prevalent (monthly, yearly, etc.) it's an adjustment from an outside perspective that the design does not assume the most common definitions of words it uses in options. Now that I get that "daily" doesn't mean Oxford "calendar daily" but "preceding days with backups" the whole section completely makes sense. I realize now that this context can be gleaned from the "docs/misc/prune-example.txt" if you parse it carefully (I admit coming up short here) but were it immediately more clear how "daily" was being defined I think I wouldn't have stumbled. I noticed the bit about a backup not being done on 2015-12-19 but didn't appreciate the significance of what it was trying to illustrate with the list of kept backups. I appreciate your work and time and the response. Thank you again. |
Beta Was this translation helpful? Give feedback.
-
I discovered that a backup wasn't pruning as I thought it was. It's a backup I run ad hoc before and after I do evil experiments on some VMs. Even though I thought I had it configured to only keep the last 30 days and 8 weeks (--keep-weekly 8 --keep-daily 30) the "30" was matching against archives from a year ago and keeping them per the output. Should the "--keep-daily" argument be doing some calendar math to prevent this or is my understanding of the docs wrong (I am willing to accept this being a result of birthdate and reading comprehension)?
Unfortunately, I don't have the archives in question as I did some manual pruning to free up some needed disk space. This got me wondering though, so I checked with a "--dry-run" against my desktop archives and was surprised to see archives from 2022 matching "rule: hourly".
Version is borg 1.2.4 on macOS 13.5.1 (Ventura).
Can someone explain why the "match" for the older archives (especially 2022) is "hourly"? I've clearly misunderstood something.
Beta Was this translation helpful? Give feedback.
All reactions