borgmatic.d per app configs don't run in the order I want them to... why? #157
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#157
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is the order I want borgmatic to run them in, and the corresponding file names of the configs.
But when running borgmatic it seems to run them in an out of order way, I think the order it ran it was: (a bit hard to tell because i only get output when I up the verbosity but v 1 is too much info and v 0 outputs nothing much)
and so it, it seems kind of random although surely it has to do with the file names.
I would like it to run it in the same order as they are listed in the directory listing but I would like to keep the descriptive naming I have for ease of editing.
No idea how to paste in code view so that formatting isn't messed up.. sorry
I attached a txt file with a better listing
Good catch. borgmatic is using Python's
os.listdir()
under the hood to list the directory, which apparently has questionable ordering semantics.Example consistent with the behavior you're seeing:
(FYI, you can format code here by surrounding it with ``` on an empty line.)
So I think the fix is to explicitly perform an alphanumeric sort when getting the nonsensical order back from
os.listdir()
.Fixed in master. Will go out as part of the next release.
Hey Dan, thanks for the reply.
Did not expect it to be a bug but rather a user error, but appreciate the humorous explanation re "questionable ordering"
Also just to clarify further in case someone else encounters this, having the configs run in the order I expect them to run is important as some of these backups are sent to much slower storage and I would prefer in this case for those configs to be run last and not block the earlier running configs.
Thanks very much.
Borgmatic is an excellent abstraction layer on top of an excellent backup system. I have been using it since atticmatic days and it has just gotten better and better.
I just recently moved my backup configs to the yaml format, which I had never encountered before. Took me quite a few tries to understand it (yaml) is a config format that very much cares about space/spacing characters. :P
I'm not a programmer but I understand python as well very much cares about spaces/tabs as, if recall correctly.
Yeah, YAML is certainly a trade-off. The upside is that it's supports more complex data structures (lists, etc.), and the downside is that it's more complex. Glad to hear borgmatic has been working out for you though!
This fix is now released as part of borgmatic 1.3.1. Enjoy!
Hello!
Just got to test it the other day, works great! Thanks again!