#3048 Issue open: no room on backup medium - selectively purge backup sets

Labels: support / question

LiamFry opened issue at 2023-09-12 07:08:

Relax-and-Recover 2.7 / Git

Is there a way to selectively purge previous backups, say by date/age?

On all my systems using rear for backup, I use external media: USB thumb, USB drive, etc. After running backups several times, I eventually fill up the media and get that dreaded "no room" error message. I don't know how rear stores/structures its backup sets so I never go poking around in the backup media. I don't want to break a recovery. My "solution" when running out of space has been to reformat the backup media before running a backup session. This works but is not ideal as I lose all previous backups.

Is there a way - even manual! - to go in to where the backup sets are stored and remove one or more that are older/oldest to free up space for the next backup?

jsmeix commented at 2023-09-12 10:08:

Simplest solution from my point of view
in particular with flash memory based storage
like USB sticks or USB SSDs:

Never use one same medium for more than one backup.
Never use a medium with a recent backup that you may need
to store one more backup on it.
For each backup use a separated clean medium.

Reason:
When a medium gets broken all the backups on it will be lost.
When you store another backup on a medium where a recent backup
already is, something could get wrong and both backups get lost.

In particular flash memory based storage
can all of a sudden become no longer accessible.
I had this once with a SSD that "just disappeared" during normal
usage - i.e. the SSD drive was suddenly no longer recognized
neither by the operating system nor by the computer's firmware.
The system had worked stable and reliably until that happened.
Tons of "well-intended advice" out there in the Internet
what one could do were useless.
That SSD had a sudden death.

Alternatively:
Save money and store several backups on one medium
and pay with a higher risk of a final disaster.

If you perfer that higher risk of a final disaster,
have a look at "USB_RETAIN_BACKUP_NR" in
usr/share/rear/conf/default.conf

How to manually clean up old backups for OUTPUT=USB:

The USB disk which is made by ReaR is a normal (bootable)
Linux disk with normal partitions (and bootloader setup)
and filesystems that can be normally mounted under Linux
so you could manually change things as you like.

What exactly there is on a ReaR USB disk
depends on your ReaR configuration
and if you use BIOS or UEFI.

In general see the section
"Relax-and-Recover versus backup and restore" in
https://en.opensuse.org/SDB:Disaster_Recovery
therein in particular those excerpts

ReaR is neither a backup software
nor a backup management software
and it is not meant to be one.
... 
ReaR only calls an external tool that does the backup of the files
during "rear mkbackup" ... (by default that tool is 'tar').
...
It is your task to ensure your backup is consistent ...
...
there is basically nothing in ReaR that deals in any further way
with what to do with the backup
...
After a "rear mkbackup" run the user has to do on his own
whatever is appropriate in his particular environment
how to further deal with the backup

[Export of Github issue for rear/rear.]