retention prefix specified, but borgmatic still errors. #402
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#402
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?
What I'm trying to do and why
I would like to set the archive name format to
{now:%Y-%m-%d}
. This requires setting the /retention/prefix key. The docs explicitely allow this to be an empty value, however bormgatic doesn't seem to recognize this.Steps to reproduce (if a bug)
/etc/borgmatic/config.yaml:
Actual behavior (if a bug)
Expected behavior (if a bug)
... just accept it? And of course, prune everything that starts differently.
Environment
borgmatic version: 1.5.12
borgmatic installation method: pacman -S borgmatic
Borg version: borg 1.1.15
Python version: Python 3.9.2
Database version (if applicable): psql (PostgreSQL) 13.2
operating system and version: Linux 5.11.7-arch1-1 (Arch Linux, complete system update yesterday)
have you https://torsion.org/borgmatic/docs/how-to/set-up-backups/#validation ?
I think the problem is here:
77980511c6/borgmatic/config/validate.py (L71)
In Python,
not prefix
will returntrue
ifprefix
is an empty string, while configuration reference says to leaveprefix
empty to disable the default, in which case--prefix
option is not passed toborg
.The problem with this is that if you do specify an archive prefix, you have to specify the pruning prefix as well. This effectively forces you to use a static prefix, which is not always the case. E.g. I use simply
'{now}'
as a prefix for my backups, since all my remote backups come from local backups on my NAS and I keep different backups in separateborg
repos.I apologize for the lengthy delay here. This feature was working "by design" with the goal of preventing users from shooting themselves in the foot with accidental pruning of archives they didn't intend to prune. But I think you've made it clear that: 1. That doesn't support your use case (an
archive_name_format
that can't be matched with a staticprefix
, and 2. It could be documented better.So given your use case, I've completely removed the restriction and updated configuration comments accordingly. These changes are in master and will be part of the next release. Thanks for filing this!
Released in borgmatic 1.6.1!