Q: How to delete specific backup? #864
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#864
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
Hi, I have two questions:
Background:
I am using btrfs snapshots as source for borgmatic. The path is always
/mnt/datavol/<snapshot>
. Before I run borgmatic the snapshot is recreated. The snapshot has approx 1TB of data, so it could happen that the connection breaks.In the situation a backup fails, I'd like to remove that entry and then redo the backup.
Steps to reproduce
No response
Actual behavior
No response
Expected behavior
No response
Other notes / implementation ideas
No response
borgmatic version
1.8.9
borgmatic installation method
Gentoo ebuild
Borg version
1.2.8
Python version
3.11.9
Database version (if applicable)
No response
Operating system and version
Gentoo Linux amd64
It's possible, but borgmatic doesn't have a "native" delete action yet. The way to do it until then is by calling through to Borg. Here's an example:
Where
host-2024-04-28T15:28:51.881598
is the name of the archive you want to delete. See theborg
action documentation for more information.Borg (and borgmatic) hide incomplete archives by default. So everything in the
borgmatic list
output is a full backup. If you want to see incomplete backups as well, you can useborg list --consider-checkpoints
.You should be able to do that with
borg delete
orborgmatic borg delete
, but if each btrfs snapshot is pretty similar to the previous one, you may find that there's actually not much space savings in manually deleting checkpoint archives—and it may actually end up slowing down backups because you have to re-backup that data instead of reusing it from the incomplete archive. Borg is pretty great at de-duplication.Thank you for the explanation. I will do some interrupted tests and see how it works out.
As for btrfs, my normal way of doing snapshots and backups is to keep them labelled like this:
It seemed to take longer for Borg to backup a new snapshot every time, so i decided on simply create a 'plain' snapshot as
/mnt/rootvol/borgmatic/root
before invoking borgmatic, so that the path to all files remain the same.Now, this is what confuse me a little. Imagine I change some files throughout the day. With my snapshots structure it is possible to recovery changes as they were at a specific hour. With Borg, if I redo the backup from a new (current) snapshot, I would loose those changes.
Ideally, I'd like to preserve the existing snapshot structure with Borg. If the hourly snapshot failed upload it would be possible to re-upload it again from one of the existing snapshots.