6

I'm playing with BareOS. I understand that, when everything is configured correctly, all backups are automatic and purges are managed so that nothing goes missing.

But while I'm getting the configuration right, I have quite a number of test backups that are of no use. In BAT, if I click on "delete" I get the warning:

Are you sure you want to delete?? !!!. (sic)

This delete command is used to delete a Job record and all associated catalog records that were created. This command operates only on the Catalog database and has no effect on the actual data written to a Volume. This command can be dangerous and we strongly recommend that you do not use it unless you know what you are doing. The Job and all its associated records (File and JobMedia) will be deleted from the catalog.Press OK to proceed with the delete operation.? (sic)

There are small variations to this message throughout the BAT software.

Now, I don't know what I'm doing so I've always clicked "cancel", but I have taken a subsequent Full backup. So I'm pretty sure that if I delete this I'll still have all the backups I need.

What is the correct process to delete backups and reclaim disk space manually?

3
  • I could be wrong, but I believe you set the retention period to a day and run your test backups.. then the purge cycle clears them out when the Media gets recycled. It's like they've gone out of their way to never delete stuff.. Which probably works really well with tapes, but now that everything is disks, it's hard to know what is on what "Media" and you can delete. To actually recover the space manually, you have to delete all the jobs associated, then you can delete the files.
    – Grizly
    May 16, 2016 at 4:16
  • Please note that bat is now deprecated in favour of the bareos-webui web interface. The delete functionality does not appear to be in webui yet. bconsole is the way to do this now, but be careful! Jun 15, 2017 at 5:46
  • bconsole only allows deletion of active jobs it seems!? i.stack.imgur.com/KBjxS.png Nov 11, 2022 at 10:35

1 Answer 1

1

As the message says, the operation will only touch the database. It will not reclaim disk space, and it will be possible to do a restore if you are determined (you need to use the bscan utility).

Usually, your jobs will be intertwined in the same Media-file (volume), at least they are in my setup, since I store to volumes 50G each in size. This means you can't delete the data of a single job, you can only delete the volume if all the jobs in it are eligible for deletion.

I have written a script which can delete volumes which don't contain any jobs worth keeping. You can find it here:

http://heim.ifi.uio.no/kjetilho/hacks/#bacula-purge-unused

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.