-
Notifications
You must be signed in to change notification settings - Fork 12
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] Week retention not working #25
Comments
Hi @vejnar, thanks a lot for spotting this. I'm about to attempt confirmation, but on first sight it does look like a bug. Moreover I think your code is simpler and more effective:
The replacement is perfect, I would only like to see a way to still have it plugged to a config variable to opt between Sunday and Monday. There's an idiom I've been using in this code for this kind of simple ternaries, I think we could have something like: cw=$(date -d "$y/$m/$d" +"%Y$(cond "$weekstart = monday" %V %U)") I'll be testing something like this, and would also like to find out what's the root problem with the timestamp based code, but because of the second point above this is really a secondary exercise, I think the code is just flawed. Also, the way you tested for this highlights a shortcoming with cmd_test(): lack of a way to test regular schedules for backups. This is already in queue (see #24) to be added when I find a little time. |
I pushed a preliminary patch in 06caa4f (fix-week-retention branch). Could you please test / review? |
Hi @3coma3. Thanks for fixing this so fast! Problem I was having is solved. My review for the patch:
|
Done! I like (as a user) to have more options, but let's go with "less is more" (which is good advice btw) Thanks a lot for the help and reporting! |
Thanks for writing and maintaining this. I am testing it with success so far, before using it in production. But I have a problem with retention as it seems not to behave as I would except, if I understand the help correctly. In particular, the "week" retention.
For example, these snapshots are tagged/not-tagged using
4 leafs, 3 days, 4 weeks, 12 months and 5 years
:I would except (13 and 20 are Sunday):
To obtain this result, I replaced:
by
lw
) saved and usingdate
to get the current week number (cw
)lw='000000'
before the loopTo test my code, I added this code at the end of the
backup
script:Does this make sense to you (if yes I can submit a PR)? Am I missing something?
The text was updated successfully, but these errors were encountered: