But there’s a trick that you can use.
It feels a bit like Houdini must have felt when he did his escapes.
Only you are not under water, in a sealed milk can or some other highly
uncomfortable situation and you have time to lean back and think, so don’t
panic.
First, list the backups using the --bypass-lock option, like so:
borg --bypass-lock list /media/nik/Borgbackup1/borgbackup/
Now, break the lock, then delete the oldest backup, so you have room to move (that is, to create a
lock file):
borg break-lock /media/nik/Borgbackup1/borgbackup/
borg delete /media/nik/Borgbackup1/borgbackup::home-2023-02-02T11:32:45
You have to break the lock here, using the --bypass-lock option with borg
delete is not allowed.
Which raises the question:
Could you first break the lock, then list, then delete?
Note to self:
Check this when the situation occurs next.
Which will happen for sure.
Now that you can work with your backups again, use that to your advantage:
If you have more old backups, you can delete them with this one liner that let’s
you remove several backups at once:
borg delete /media/nik/Borgbackup1/borgbackup/::$(borg list /media/nik/Borgbackup1/borgbackup/ | grep 2022 | cut -d ' ' -f 1)
|
Note
|
This solution may not be appropriate in a company environment.
I have no idea how breaking locks may affect critical infrastructure.
It was a solution that helped me out in a safe, private setup.
I can provide no guaranty about the security implications of the steps shown here
in a general IT environment!
|