BEAM.CONF

NAME
DESCRIPTION
SYNTAX
GENERAL SETUP
S3 SETUP
TAR SETUP
BACKUP ITEMS
FS BACKUP TYPE
POSTGRES BACKUP TYPE
MYSQL BACKUP TYPE
LDAP BACKUP TYPE
MAIL NOTIFICATION
HOOKS
EXAMPLES
SEE ALSO
AUTHORS
BUG REPORTS

NAME

beam.conf - configuration file for BEAM

DESCRIPTION

The beam.conf file defines what data are to be included in the backup, what backup methods to use and where to store the resulting archives. The backup(1) and restore(1) utilities expect to find it in the /usr/local/etc directory.

SYNTAX

The file is essentially a shell script that defines variables controlling backup and restore procedures. Names of the variables used by the backup scripts begin with backup_.

GENERAL SETUP

backup_umask=MASK

Sets file mode creation mask. This mask will apply to all files created during the backup: archives, snapshots and temporary files. The default mask is 077.

backup_tmp_dir=DIR

Sets the directory where temporary files will be stored. The default is /tmp.

backup_logfile=FILE

If set, redirect standard error and standard output to that file. The file will be created if it does not exist. Otherwise, the output will be appended to it.

By default, this file will be automatically rotated. See openlog_hook below for a discussion of this.

backup_logrotate_conf=TEXT

Configuration text for logrotate(8), used to rotate the logfile. The default corresponds to:

backup_logrotate_conf = "

weekly

rotate 4"

Note, that no block statements are allowed within backup_logrotate_conf, because its entire contents will be placed within an appropriate block statement.

backup_rsh_command=COMMAND

Use this command to access remote archives. Unless set, the backup utilities will first look for an executable file named /usr/local/bin/speedssh. If not found, they will fall back to using /usr/bin/ssh. It is the responsibility of the administrator to provide for authentication on the remote system, e.g. by using shared-key authentication.

backup_retain_interval=NUMBER

Sets the interval, in weeks, during which old backups and snapshots are retained. Empty value or zero means never delete the backups.

This variable is used by backup(1), which calls backup-cleaner(1) if it is set.

S3 SETUP

To keep archives in a s3 bucket you will need the s3backer(1) utility.
backup_s3backer_options
=LIST

Additional options for s3backer(1).

Use it, e.g., to pass the --vhost option if your bucket is located outside of the US region.

backup_bucket_name=STRING

Sets the name of the s3 bucket to keep the archives in.

backup_mp_s3backer=DIR

Defines mount point for the "raw" bucket.

Default value is /mnt/s3backer.

backup_mp_s3=DIR

Defines mount point for the actual s3-backed filesystem.

Default value is /mnt/s3.

TAR SETUP

Tar setup variables control additional options and arguments passed to tar(1).
backup_tar_options
=LIST

Use this variable to pass additional options to tar. Do not place tar operation switches (such as -c, -t, etc.) here! These will be added automatically by appropriate scripts, depending on the operation being performed.

By default this variable is empty (no additional options passed to tar).

backup_suffix=STRING

This variable supplies suffix for created archive names. The default is tar . The dot is inserted between the file name and its suffix.

This variable is useful if you request compression and want archive file names to reflect it. For example:

backup_tar_options="-j"
backup_suffix="tar.bz2"

backup_archive_dir=DIR

Directory where archive files are located. It’s OK to specify a remote directory here, e.g.

backup_archive_dir="10.10.0.1:/export/backup"

This variable must be defined and whatever directory it points to must already exist.

If it is not defined and backup_bucket_name is set, indicating that the S3 storage is used for backups, backup_archive_dir will be set automatically to the same value as backup_mp_s3.

backup_snapshot_dir=DIR

Directory for incremental snapshot files. These files are be named after their archive counterparts, by appending the .db suffix.

backup_verbose=N

Set this variable to any non-empty value to request additional verbosity. The effect of this setting depends on backup methods being used. For example, the fs method adds a -v option to each invocation of tar(1).

BACKUP ITEMS

A backup item identifies information that needs to be backed up. Syntactically, items follow the same rules as shell variable names. Backup items are introduced using the following variable:
backup_items
=LIST

A whitespace-separated list of backup items.

For each backup item name the configuration file must provide a set of variables describing where to obtain this information and how to store it to the archive. These variables follow the same naming convention:

name_var

where name is the item name and var is a valid shell identifier.

The name_type variable must always be defined. It identifies the backup method to be applied to that item. The following backup methods are implemented:

fs

A file system backup.

postgres

Backup of PostgreSQL databases.

mysql

Backup of MySQL databases.

ldap

Backup of LDAP databases.

FS BACKUP TYPE

This is the basic backup type. It creates incremental backups of a specified file system. For each item of this type, the following variables must be defined:
item
_dir=PATH

The absolute path to the file system being backed up.

item_files=LIST

A whitespace-separated list of directories and/or files in the item_dir directory.

The following variables are optional:
item
_exclude=LIST

A whitespace-separated list of file names (or glob(3) patterns) to exclude from archivation. This is translated to a list of --exclude options to tar(1). Make sure to quote globbing patterns as you would have done in shell, to prevent them from being expanded too early. For example:

system_exclude="’var/spool/mail/*’"

item_exclude_from=LIST

A list of files to read exclusion patterns from. It is translated into a list of --exclude-from options.

item_tar_options=LIST

A list of additional options to pass to tar. Use this with caution.

For example:

backup_items="system"

system_type=fs
system_dir="/"
system_files="etc var/spool"

This configuration requests incremental backups of everything found in the directories /etc and /var/spool.

POSTGRES BACKUP TYPE

The postgres type creates a dump of a PostgreSQL database and archives it using tar(1). The following variables must be defined for items of this type:
item
_database=STRING

The database name.

MYSQL BACKUP TYPE

The mysql backup type creates a dump of a MySQL database and archives it with tar(1). The database to dump and access credentials are specified using the following variables:
item
_database=STRING

The database name. If this variable is empty, all databases will be dumped.

item_defaults_file=FILE

A full pathname of the MySQL defaults file which contains credentials for accessing this database. This file must have at least the mysqldump and mysql sections, the former being used when dumping the database and the latter when restoring it.

LDAP BACKUP TYPE

A LDAP database is introduced with the ldap backup type. The following keywords specify what to backup:
item
_database_directory=DIR

Specifies the pathname of a directory that contains the database files. This is used at restore time to clean up old database contents prior to restoring it.

item_database_number=NUMBER

Number of the database to dump, if your LDAP configuration contains several databases. If absent, all databases will be dumped. This keyword cannot be used in conjunction with item_database_suffix (see below).

item_database_suffix=STRING

Use the specified suffix to determine which database to operate upon.

item_uri=URI

Use dn, scope and filter from the supplied argument URI to handle only matching entries.

item_user=NAME

Restore the database with the privileges of this user.

item_slapcat_options=LIST

A list of additional options for slapcat(8C). Use with caution.

item_slapadd_options=LIST

A list of additional options to pass to slapadd(8C) when restoring from the backup.

MAIL NOTIFICATION

Apart from usual logging, backup reports can be sent via email to selected recipients. To enable this feature, the variable backup_notify_email must be defined to a comma-separated list of recipient email addresses.

A number of variables is provided to customize the email headers and contents.
backup_notify_email
=LIST

Sets a list of emails to receive backup report. Multiple emails must be separated with commas. If not set, no notification will be sent.

backup_sender_email=EMAIL

Defines the sender email address. Backup reports will appear to be sent from this address. The default value is root@hostname, when hostname is the name of the host on which the backup is run.

If set, this variable must contain a single email address, without personal part or comments, e.g.

backup_sender_email=root@example.com

backup_sender_personal=STRING

Defines personal part of the sender email. The personal part will be enclosed in double quotes and prepended to the value of backup_sender_email to form a valid RFC-2822 From header. For example, if you have:

backup_sender_email=root@example.com
backup_sender_personal="Automatic backup report"

then the resulting report will contain:

From: "Automatic backup report" <root@example.com>

backup_report_headers=LIST

Defines additional headers for the report message. By default, the following headers are generated: From, To, Subject, X-Beam-Items, X-Beam-Round, and X-Beam-Level. The three X- headers contain the backed up items (as set in the backup_items variable), backup round and backup level numbers, correspondingly.

To supply multiple headers, delimit them with single newline characters.

backup_report_intro=TEXT

Sets the introductory text to be displayed before the actual report.

backup_report_signature=TEXT

Sets the signature text, which will be output after the report body.

backup_mailer_program=COMMAND

Defines the mailer program and its arguments. The default is

/usr/sbin/sendmail -oi -t -F $backup_sender_email

HOOKS

Special variables, called hooks, allow you to supply arbitrary commands to be run at particular stages of the backup or restore process.
openlog_hook
=LIST

Commands listed in this variable are run before opening the logfile. The most common use for this hook is to rotate an oversized logfile prior to opening it.

The default configuration file initializes this hook with beam_logrotate, a shell function that uses logrotate(8) to manage the log file. Configuration for logrotate(8) can be supplied in the backup_logrotate_conf variable. By default, the log file is rotated weekly and 4 weeks worth of backlogs are preserved.

prologue_hook=LIST

This variable contains a whitespace-separated list of commands to be invoked before starting backup (or restore). These commands are started in order of their appearance in the list and are called without arguments. By default, this variable is empty.

epilogue_hook=LIST

This variable contains a whitespace-separated list of commands to be invoked after the backup (or restore) has finished. These commands are started in order of their appearance in the list and are called without arguments. By default, this variable is empty.

EXAMPLES

A simple configuration file for backing up the contents of /etc, /home, and the PostreSQL database savane:

# Request bzip2 compression:
backup_tar_options="-j"
# Modify file name suffix accordingly
backup_suffix="tar.bz2"
# Write data to /dev/rmt1 on a remote machine:
backup_archive_dir=192.168.0.1:/dev/rmt1
# Keep snapshots in this directory:
backup_snapshot_dir=/var/snapshots

# Two backup items are defined:
backup_items="dbdump system"

# The dbdump item dumps the database:
dbdump_type=postgres
dbdump_database=savane

# The system item backs up the file system:
system_type=fs
system_dir="/"
system_files="etc home"

# Notify root about the results.
backup_notify_email=root@example.com
backup_sender_email=devnull@example.com
backup_sender_personal="Automatic daily backup"
backup_report_intro="Today’s daily backup produced the following
results."
backup_report_signature="--
Best regards,
Beam Automatic Backup"

SEE ALSO

beam(1), beam-restore(1), beam-backup(1), beam-cleaner(1).

AUTHORS

Sergey Poznyakoff

BUG REPORTS

Report bugs to <gray@gnu.org.ua>.


Manpage server at man.gnu.org.ua.

Powered by mansrv 1.1