Permalink
Fetching contributors…
Cannot retrieve contributors at this time
339 lines (239 sloc) 11.2 KB

Configuring Holland

By default, Holland's configuration files reside in /etc/holland. The main configuration file is holland.conf, however there are a number of other configuration files for configuring default settings for providers and for configuring backup sets.

Each configuration file has one ore more sections, defined by square brackets Underneath each section, one or more configuration option can be specified. These options are in a standard "option = value" format. Comments are prefixed by the # sign.

Note that many settings have default values and, as a result, can either be commented out or omitted entirely.

Global Config

The main configuration file (usually /etc/holland/holland.conf) defines both global settings as well as the active backup sets. It is divided into two sections :ref:`[holland]<holland-config>` and :ref:`[logging]<logging-config>`.

[holland]

[logging]

Example

## Root holland config file
[holland]

## Paths where holland plugins may be found.
## Can be comma separated
plugin_dirs = /usr/share/holland/plugins

## Top level directory where backups are held
backup_directory = /var/spool/holland

## List of enabled backup sets. Can be comma separated.
## Read from <config_dir>/backupsets/<name>.conf
# backupsets = example, traditional, parallel_backups, non_transactional
backupsets = mydbbackup, pgdump-full, mysql-lvm-reportingdb

# Define a umask for file generated by holland
umask = 0007

# Define a path for holland and its spawned processes
path = /usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

[logging]
## where to write the log
filename = /var/log/holland.log

## debug, info, warning, error, critical (case insensitive)
level = info

Backup-Set Configs

Backup-Set configuration files are housed in /etc/holland/backupsets with the name of the backup-set being the name of the file before the .conf suffix (e.g. 'myfavoritebackup.conf' is the configuration file for the 'myfavoritebackup' backup-set).

The backups themselves are placed under the directory defined in the :ref:`backup_directory<holland-config-backup_directory>` section of the main configuration file. Each backup resides under a directory corresponding to the backup-set name followed by one or more date-encoded directories.

Backup-Set configuration files inherit the configuration options of the specified plugins (though these settings can be overridden). To define a provider plugin for the backup set, you must put the following at the top of the backup set configuration file.

[holland:backup]
plugin = <plugin>
backups-to-keep = #
estimated-size-factor = #

[holland:backup] Configuration Options

This section is for configuring Holland specific options and is usually at the top of a particular backup set configuration file. These options control the behavior of Holland itself, rather than of the backup provider and associated helper plugins (which are defined within their own sections - see below).

Hooks

For all hook commands, Holland will perform simple text substitution on the three parameters:

  • hook: The name of the hook being called (one of: before-backup-command, after-backup-command, failed-backup-command)
  • backupdir: The path to the current backup directory (e.g. /var/spool/holland/mysqldump/YYYYmmdd_HHMMSS)
  • backupset: The name of the backupset being run (e.g. mysql-lvm)

For Example

[holland:backup]
plugin = mysqldump
before-backup-command = /usr/local/bin/my-custom-script --hook ${hook} --backupset ${backupset} --backupdir ${backupdir}
after-backup-command = echo ${backupset} completed successfully.  Files are in ${backupdir}
failed-backup-command = echo "${backupset} failed!" | mail -s "${backupset} backup failed" sysadmins@example.com

Provider Plugin Configs

The following are the provider plugins that can be used in a backup-set. These are used within their own braced section in the backup-set configuration file. For specific information on how to configure a desired provider, see the list below.

For advanced users, the defaults for each provider plugin can be changed by editing the default configuration file for said provider. These files are located in /etc/holland/providers by default.

MySQL Plugins

Other Plugins

Helper Plugins

Backup Set Config Example

Here is an example backup set which uses mysqldump to backup all but a few databases, in a one-file-per-database fashion. For more specific examples, consult the documentation for the specific provider plugin you wish to use (see above).

[holland:backup]
plugin = mysqldump
backups-to-keep = 1
auto-purge-failures = yes
purge-policy = after-backup
estimated-size-factor = 0.25

[mysqldump]
extra-defaults = no
lock-method = auto-detect
databases = *
exclude-databases = "mydb", "myotherdb"
exclude-invalid-views = no
flush-logs = no
flush-privileges = yes
dump-routines = no
dump-events = no
stop-slave = no
max-allowed-packet = 128M
bin-log-position = no
file-per-database = yes
estimate-method = plugin

[compression]
method = gzip
inline = yes
level = 1

[mysql:client]
defaults-extra-file = ~/.my.cnf