Pruning and Recycling Example
Perhaps the best way to understand the various resource records that come into play during automatic pruning and recycling is to run a Job that goes through the whole cycle. If you add the following resources to your Director’s configuration file:
Schedule {
Name = "30 minute cycle"
Run = Level=Full Pool=File Messages=Standard Storage=File
hourly at 0:05
Run = Level=Full Pool=File Messages=Standard Storage=File
hourly at 0:35
}
Job {
Name = "Filetest"
Type = Backup
Level = Full
Client=XXXXXXXXXX
FileSet="Test Files"
Messages = Standard
Storage = File
Pool = File
Schedule = "30 minute cycle"
}
# Definition of file storage device
Storage {
Name = File
Address = XXXXXXXXXXX
SDPort = 9103
Password = XXXXXXXXXXXXX
Device = FileStorage
Media Type = File
}
FileSet {
Name = "File Set"
Include {
Options { signature=MD5 }
File = fffffffffffffffff
}
Exclude { File=*.o }
}
Pool {
Name = File
Use Volume Once = yes
Pool Type = Backup
LabelFormat = "File"
AutoPrune = yes
VolumeRetention = 4h
Maximum Volumes = 12
Recycle = yes
}
Where you will need to replace the ffffffffff’s by the appropriate files to be saved for your configuration. For the FileSet Include, choose a directory that has one or two megabytes maximum since there will probably be approximately eight copies of the directory that Bacula will cycle through.
In addition, you will need to add the following to your Storage daemon’s configuration file:
Device {
Name = FileStorage
Media Type = File
Archive Device = /tmp
LabelMedia = yes;
Random Access = Yes;
AutomaticMount = yes;
RemovableMedia = no;
AlwaysOpen = no;
}
With the above resources, Bacula will start a Job every half hour that saves a copy of the directory you chose to /tmp/File0001 … /tmp/File0012. After 4 hours, Bacula will start recycling the backup Volumes (/tmp/File0001 …). You should see this happening in the output produced. Bacula will automatically create the Volumes (Files) the first time it uses them.
To turn it off, either delete all the resources you’ve added, or simply comment out the record in the resource.
Go back to the Storage Space Management chapter.
Go back to the main Bacula Enterprise Management page.