Order of default actions? #873

Open
opened 2024-05-22 21:57:23 +00:00 by sshaikh · 5 comments

What I'm trying to do and why

My reading of the docs is that in the absence of any verbs, borgmatic will: prune, compact, create and check. However, based on the hooks that execute, the actual order is: create, compact, prune, check.

Steps to reproduce

Run sudo borgmatic -c config.yaml with simple echos on the after_ hooks.

Actual behavior

No response

Expected behavior

No response

Other notes / implementation ideas

No response

borgmatic version

1.8.11

borgmatic installation method

pipx

Borg version

1.2.8

Python version

3.11.2

Database version (if applicable)

No response

Operating system and version

Debian GNU/Linux 12 (bookworm)

### What I'm trying to do and why My reading of the docs is that in the absence of any verbs, borgmatic will: prune, compact, create and check. However, based on the hooks that execute, the actual order is: create, compact, prune, check. ### Steps to reproduce Run `sudo borgmatic -c config.yaml` with simple `echo`s on the after_ hooks. ### Actual behavior _No response_ ### Expected behavior _No response_ ### Other notes / implementation ideas _No response_ ### borgmatic version 1.8.11 ### borgmatic installation method pipx ### Borg version 1.2.8 ### Python version 3.11.2 ### Database version (if applicable) _No response_ ### Operating system and version Debian GNU/Linux 12 (bookworm)
Author

setting verbosity to 1 seems to confirm the behavior.

setting verbosity to 1 seems to confirm the behavior.
Author

In the CLI reference I see this:

Simple, configuration-driven backup software for servers and workstations. If
no actions are given, then borgmatic defaults to: create, prune, compact, and
check.

Which is closer to what I see when running it, so perhaps this is a documentation issue (even though I think prune, compact, create, check is the most appropriate order, so maybe the solution here is to always be explicit).

In the CLI reference I see this: ``` Simple, configuration-driven backup software for servers and workstations. If no actions are given, then borgmatic defaults to: create, prune, compact, and check. ``` Which is closer to what I see when running it, so perhaps this is a documentation issue (even though I think prune, compact, create, check is the most appropriate order, so maybe the solution here is to always be explicit).
Owner

Thanks for taking the time to file this! The default ordering is indeed create, prune, compact, check, but where in the docs are you seeing that the actual order is otherwise? There were a few cases where the actions happened to be listed in the non-default order in the docs (see the linked changeset), but I didn't find anywhere that outright said the default order is other than create, prune, compact, check. Of particular interest is the start of these docs.

Which is closer to what I see when running it, so perhaps this is a documentation issue (even though I think prune, compact, create, check is the most appropriate order, so maybe the solution here is to always be explicit).

That actually used to be the default order in older versions of borgmatic. See #304 for the details on why it was changed. But yeah, you can specify any order you like on the command-line.

Thanks for taking the time to file this! The default ordering is indeed `create`, `prune`, `compact`, `check`, but where in the docs are you seeing that the actual order is otherwise? There were a few cases where the actions happened to be listed in the non-default order in the docs (see the linked changeset), but I didn't find anywhere that outright said the default order is other than `create`, `prune`, `compact`, `check`. Of particular interest is the start of [these docs](https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/#biggish-data). > Which is closer to what I see when running it, so perhaps this is a documentation issue (even though I think prune, compact, create, check is the most appropriate order, so maybe the solution here is to always be explicit). That actually used to be the default order in older versions of borgmatic. See #304 for the details on why it was changed. But yeah, you can specify any order you like on the command-line.
Author

I may have missed the "prior version" label in the below:

Prior to version 1.7.9 The default action ordering was prune, compact, create, and check.

That said, I still believe that the default I'm seeing is create, compact, prune, check but I'll see if I can confirm that.

I may have missed the "prior version" label in the below: ``` Prior to version 1.7.9 The default action ordering was prune, compact, create, and check. ``` That said, I still believe that the default I'm seeing is create, compact, prune, check but I'll see if I can confirm that.
Owner

Hmm, yeah, let me know if you're somehow seeing that still.. ideally with logs! Here's the relevant code from main that applies the default ordering:

        for default_action_name in ('create', 'prune', 'compact', 'check'):
Hmm, yeah, let me know if you're somehow seeing that still.. ideally with logs! Here's the relevant code from `main` that applies the default ordering: ```python for default_action_name in ('create', 'prune', 'compact', 'check'): ```
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#873
No description provided.