Bacula Backup

Configuration

Filesets

Source

When creating filesetz in the configuration, it sometimes can be useful to be able to create a list of directories of files on the file.

The option File= supportes inline scripts that allow you to do that:

...
Fileset {
  ....
  File = "\\|find /export/home -type f -name '.somefile' \
                      -exec dirname {} \;"
  ...

Maintenance

Pruning volumes

Source

  • Find old volumes
mysql> SELECT VolumeName, VolStatus FROM Media WHERE LastWritten < 'yyyy-mm-dd';
+----------------------------+-----------+-----------+
| VolumeName                 | VolStatus | StorageId |
+----------------------------+-----------+-----------+
| hq-windows-large-incr-9319 | Error     |        34 |
| hq-windows-large-full-9332 | Error     |        33 |
| hq-windows-large-incr-9373 | Error     |        33 |
| hq-windows-small-incr-9376 | Error     |        33 |
| hq-windows-large-incr-9377 | Full      |        33 |
| hq-windows-large-incr-9378 | Error     |        33 |
| hq-windows-large-incr-9384 | Error     |        33 |
+----------------------------+-----------+-----------+
7 rows in set (0.01 sec)
  • Prune those volumes base on the retention days:
mysql> SELECT CONCAT('prune yes volume=', VolumeName) FROM Media WHERE LastWritten < 'yyyy-mm-dd';
*prune yes volume=hq-windows-large-full-9332
The current Volume retention period is: 1 month
*prune yes volume=hq-windows-large-incr-9373
The current Volume retention period is: 14 days
*prune yes volume=hq-windows-small-incr-9376
The current Volume retention period is: 14 days
*prune yes volume=hq-windows-large-incr-9377
The current Volume retention period is: 14 days
*prune yes volume=hq-windows-large-incr-9378
The current Volume retention period is: 14 days
*prune yes volume=hq-windows-large-incr-9384
The current Volume retention period is: 14 days
  • Remove the volumes from the Catalog:
*delete yes volume=hq-windows-large-incr-9319

This command will delete volume hq-windows-large-incr-9319
and all Jobs saved on that volume from the Catalog
*delete yes volume=hq-windows-large-full-9332

This command will delete volume hq-windows-large-full-9332
and all Jobs saved on that volume from the Catalog
*delete yes volume=hq-windows-large-incr-9373

This command will delete volume hq-windows-large-incr-9373
and all Jobs saved on that volume from the Catalog
*delete yes volume=hq-windows-small-incr-9376

This command will delete volume hq-windows-small-incr-9376
and all Jobs saved on that volume from the Catalog
*delete yes volume=hq-windows-large-incr-9377

This command will delete volume hq-windows-large-incr-9377
and all Jobs saved on that volume from the Catalog
*delete yes volume=hq-windows-large-incr-9378

This command will delete volume hq-windows-large-incr-9378
and all Jobs saved on that volume from the Catalog
*delete yes volume=hq-windows-large-incr-9384

This command will delete volume hq-windows-large-incr-9384
and all Jobs saved on that volume from the Catalog
  • Remove the volume from the disk
sudo rm hq-windows-large-incr-9319
sudo rm hq-windows-large-full-9332
sudo rm hq-windows-large-incr-9373
sudo rm hq-windows-small-incr-9376
sudo rm hq-windows-large-incr-9377
sudo rm hq-windows-large-incr-9378
sudo rm hq-windows-large-incr-9384