12 April 2024
Bacula: delete volumes without confirmation

Bacula: delete volumes without confirmation

19 February, 2024

Let's say you have to purge and clear your old backup files from Bacula. Going through them one by one is a lengthy process (especially if you have to-disk backups):

The long way: in bconsole, type:

*delete

You have the following choices:
     1: volume
     2: pool
     3: jobid

*volume

Defined Pools:
     1: Default
     2: File
     3: Scratch
     4: alt-pool

+---------+------------+-----------+--------------+-----------+---------------------+
| MediaId | VolumeName | VolStatus | VolRetention | MediaType | LastWritten         |
+---------+------------+-----------+--------------+-----------+---------------------+
|       1 | ALT0001    | Full      |    1,209,600 | File      | 2015-10-05 00:03:02 |
+---------+------------+-----------+--------------+-----------+---------------------+

Enter *MediaId or Volume name: ALT0001

Finally you get a confirmation: are you sure? (yes/no). That's 5 steps! If you need to delete 50 volumes, you'll be in for a while. Luckily, bacula has some shortcuts:

delete yes volume=ALT0001

The above command will achieve you the same results in 1 step and quickly delete as many volumes as needed.

PS: For those who don't know, Bacula is an open-source, enterprise grade backup suite, running on Windows and Linux.

Starbeam Systems

© Starbeam Systems. All rights reserved.