What to configure for a director. This is not a complete reference, just what I will likely change or use.
Bacula expects all configuration files in UTF-8. LANG must end in .UTF-8 (for example en_US.UTF-8).
http://www.bacula.org/5.2.x-manuals/en/main/main/Configuring_Director.html
https://help.ubuntu.com/12.04/serverguide/bacula.html
Configuration file: /etc/bacula/bacula-dir.conf
Director {}
Name - give a good and meaningful name
Password - if a random one is generated, it's good enough
Maximum Concurrent Jobs: default 1 is OK. If increase the number, read reference document - it's better to locate concurrent jobs to different volume to avoid interleaving.
DirAddress / DirAddresses / DirPort: on which address / port to listen (for console to connect)
Client {}
Name, Address, FDPort, Catalog, Password - director names explained purpose
File Retention : for how long the RECORD of the file (not the file archive itself) is kept in Catalog and not removed by Auto Prune
Job Retention : for how long the record of the job is kept before Auto Prune; all file record associated with the job will also be removed
Performance tuning directives, see below...
Maximum Concurrent Jobs = number
Maximum Bandwidth Per Job = speed specified in k/s, Kb/s, m/s or Mb/s.
Priority = number
Storage {}
Name = name, will be referred by Job
Address = address
SD Port = port
Password = password
Device = specifies the {Device}{Name} in Storage daemon's configuration (bacula-sd.conf). Do not define two Storage resources in Director pointing to the same Device in the Storage.
Media Type = any unique, identifying and descriptive id to each distinct media type. Do not use same type to different media type however the difference is little. If using file: make absolutely sure each Device defined in Storage and hence in Director has a unique media type, as files cannot be mounted / moved like a real media. Same is true if do not want Bacula to use media device indiscriminately. Just remember Bacular may choose any media device with the same type to use when doing a restore.
Autochanger = no (until when I really use something with an autochanger)
FileSet {}
Name = name
Include {Options {file options} ...; file-list}
- may have one or more Include resources,
- each with its own options and list of full path of directories or files;
- file-list consists of one file / dir name per line;
- dir names should not be specified with trailing slash;
- use Unix path notation (i.e. forward slash - even for windows, c:/...);
- may enclose path with double quotes particularly if contains spaces
- be careful not to include a dir twice (which is very easy such as both "/" and "/usr") which causes double backup and waste
- when using wild-cards or regular expressions, dir names always terminated with "/" and file names not
Options {}
- for wild-cards and regular expression matching options, match in the order and found match if any (and the first one) matches
- in case no match was found, Bacular use the options found in the last Options resource (so to put a default options after any other)
- in case one options resource matches the file under consideration, the options will apply and no other options will be further looked at
- recommended to put all wild-card and regex expressions inside double quotes
- compression = GZIP, GZIP1 ~ GZIP9 (max compression), LZO (avoid compression if hardware already does so)
- signature = SHA1, MD5 (MD5 faster but less secure, if it is a concern)
- basejob = option for full backup, see official doc for details
- verify = see official doc; a useful set is "pins5", i.e. compare permission bits, inodes, number of links, size, and MD5
- onefs = yes (default) / no; yes is preferred and avoids possible getting into infinite loop;
- checkfilechanges = yes (recommended), check after backup and see if file changed
- wild = a wild-card string to be applied to select or exclude file names and dir names (Exclude=yes)
- wilddir = apply to dir names only; select or exclude
- wildfile = same as above but to file names only
- regex, regexfile, regexdir
- exclude = yes / no (default no)
- ignore case = yes / no
- Exclude Dir Containing = may be used to specify an indicating file to exclude the entire dir if found
- sparse = yes; when saving a block device such as /dev/hda1, this makes saving just the actual data rather than the whole partition
- note: when backup raw device, not to specify the symbol link (LVM) but the device itself; also it's strongly urged that the partition is NOT MOUNTED at the time of backing up, or mounted read only
Exclude {file-list}
file-list: a list of names with File= directive; wild-cards not interpreted here (use in options); use include: "@ /path/to/file-list" specify an external file containing a list of files each preceded by a "File ="; any name start with "|" means a program that outputs a list of files or dirs one per line; any name starts with "<" is a file containing a list of dirs or files one per line, start from column 1, shout NOT be quoted even contains spaces; \< or "\\<" (with quotes) indicates the file is read on client machine rather than server machine
Note: FileSet is identified by both name and MD5 of Include/Exclude contents. Each time a new File Set is created (include any change to the list of included files) the next backup is always full backup.
Note: normally all files under path will be backed up recursively but Bacula normally will NOT cross file system. That means even another file system is mounted in a path under a route, which is to be backed up, that another file system will not be backed up unless specified explicitly.
Note: default rule is to select everything to back up unless excluded. So specify wildcard file name and expect backup will only be done to such files will fail (those files will be backed up, along with other necessary files). Put an exclude everything in the same Include directive.
Note: currently (5.2.x) regular expression engine may be system dependent, so use "estimate job=job-name listing" in the console to test the expression.
Note: it's better to test FileSet before applying it. Use the 'estimate' command in Console, such as "estimate job=<any-job-name> listing client=<desired-client> fileset=name-of-fileset
Pool {}
Pool (1) organizes set of storage Volumes and (2) assign default attributes to new Volume in the pool (can be override individually).
Pool can be defined in Director's configuration or through "create" command in console program, but finally, all definition is put into database and the version in database matters. "update pool" console command to refresh the database image from Directors configuration file (it will also be updated when Bacula restart).
When labeling physical media with label command, add Volume names to the Pool.
Name = name
Maximum Volumes = number (for limiting number of volumes in Autochangers or for File storage the number of disk files)
Pool Type = Backup (the only one current implemented)
Storage (optional) = storage-resource-name, defines the storage services where to backup the data; if also specified in Job, the value in Pool overrides.
Maximum Volume Jobs = n, (default = 0, no limit); when the number is reached Volume will be marked "Used"
Maximum Volume Files
Maximum Volume Bytes = size, (default = 0, no limit)
Volume Use Duration = time-period-specification, period where Volume can be written, from first writing; might be used for ensuring incremental backup after a full backup in one volume.
AutoPrune = yes (default) / no, if automatically apply Volume Retention period when new Volume is needed and no appendable Volumes exist in the Pool
Volume Retention = time-period-specification, retention period counted after the End time of each Job written to the Volume, also see AutoPrune, effect is may prune Job records older than retention period if need to free up a Volume (as late as possible); if a Full backup is gone, next Incremental or Differential backup will be promoted to a Full backup. The minimum Volume Retention should be at least twice the interval of Full backups. Note once volume is created changing default will not change the value attached to the volume. Use update command to do this.
Recycle = yes / no; default yes, recycle Purged Volume (that is all Jobs and Files expired and therefore deleted from the Catalog)
File Retention = time-period, how long the file record will be kept in Catalog, takes precedence over Client directives, affects records in database (not the file)
Job Retention = time-period
Label Format = template, for auto naming a new and automatically labeled Volume, in double quotes, $ or [ marks start of expansion variables defined in Variable Expansion Vars chapter
Scratch pool : if a pool is named "Scratch", Volumes within it will be moved out to any pool that requires a new Volume and cannot find one.
Schedule {}
Name = name
Run = job-overrides date-time-specification
Job-overrides is (keyword = value) permitting overriding the Level / Storage / Messages / Pool specifications
Date-time-specification. Keywords:
See official document for definition / samples and details.
Note: "show schedules" command in the Console show the scheduled bits
Job {}
For Full, Differential, Incremental backups define a single Job to tie them together. Normally only one job per client. Do not support multiple Storage daemons at this time.
Name = name (good idea to name job as client)
Enabled = yes / no
Type = Backup / Restore (must be manually started) / Verify / Admin (do periodically catalog pruning)
Level = (not required and usually specified in the Schedule) see end of Job{} section
JobDefs = jobdefs-resource-name, use values from the defs as defaults
Client = which client to backup, single client only in any one Job
FileSet = which files to back up, single FileSet for one Job
Messages = where to log or send messages, required
Pool = where to backup
Full Backup Pool = overriding Pool, where to put full backup
Differential Backup Pool / Incremental Backup Pool
Schedule = schedule, which determines time and also level of backup; only a single Schedule can be specified (which can contain multiple 'Run' directives)
Storage = the storage service where to back up
Max Start Delay = time, after which job will be canceled if not actually started (for example to prevent job starting at work hours)
Max Run Time = time
Incremental/Different Max Start/Run/Wait time, etc, for various time control
Maximum Bandwidth = speed (k/s, kb/s, m/s, mb/s)
Max Full Interval = time, after which from a successful full backup, to promote partial to full
Prefer Mounted Volumes = default yes
RunScript {body of commands to run as external program prior or after current job, for example stop/start daemon, dump data, etc, see document}
Duplication handling directives - see official document, just be noted there exists various controls
Priority = default 10, higher number lower priority; affects consequence of execution in queue
Levels for Backup
Levels for Verify
Catalog {}
Name - give a good and meaningful name; will be referred in other directives
Also it's the place to configure database if anything needs to be changed
Messages {}
Change the email addresses
File "/var/lib/bacula/log" needs to be manually rotated otherwise it will grow indefinitely.