'\" t
.\" Title: safekeep.backup
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 07/23/2022
.\" Manual: SafeKeep Client Configuration
.\" Source: safekeep
.\" Language: English
.\"
.TH "SAFEKEEP\&.BACKUP" "5" "07/23/2022" "safekeep" "SafeKeep Client Configuration"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
safekeep.backup \- Configuration file for a \*(Aqsafekeep(1)\*(Aq client
.SH "SYNOPSIS"
These files are usually placed in /etc/safekeep/backup\&.d/, or optionally in ~/\&.safekeep/backup\&.d/ for non\-root users, to be picked up automatically by \fIsafekeep(1)\fR\&. They must have a \&.backup extension\&.
.SH "DESCRIPTION"
Each configuration file controls the backup of a host\&. They are typically named after the hostname of the machine they control the backup for, and have a \fI\&.backup\fR extension (e\&.g\&. mailbox\&.backup)\&. These files are written in XML\&. Virtually all elements and attributes are optional; if not present, safekeep(1) will provide reasonable, useful defaults\&.
The full set of supported elements and attributes looks as follows:
.sp
.if n \{\
.RS 4
.\}
.nf
\-\->
.fi
.if n \{\
.RE
.\}
.SH "PARAMETERS"
XML elements and attributes are referred to via XPath expressions: elements are separated by \fI/\fR, attributes are introduced by \fI@\fR:
.PP
/backup
.RS 4
The root element of the XML file\&. Mandatory\&.
.RE
.PP
/backup/@id
.RS 4
This is the ID by which safekeep(1) will address this host\&. If specified it overrides the default value derived from the filename\&. Optional, defaults to the filename without the \&.backup extension\&. Use of the default value is \fBhighly\fR recommended\&.
.RE
.PP
/backup/@enabled
.RS 4
If specified and set to \fIfalse\fR or \fI0\fR, it disables this host\&. It is a nicer way to disable a host without renaming the file\&. Optional, defaults to \fItrue\fR\&.
.RE
.PP
/backup/host/@name
.RS 4
The name or IP address of the client\&. If you need to backup the box that the server is running from, you can set this to "localhost"\&. This is different from leaving it blank, as it will establish a SSH session and use the user specified by /backup/host/@user\&. Optional, defaults to local access\&.
.RE
.PP
/backup/host/@port
.RS 4
The network port to use when connecting to the client\&. This must be a number and is passed to the network connection agent, usually SSH\&. Optional, default to not passing any port specification\&.
.RE
.PP
/backup/host/@user
.RS 4
The user name to use when connecting to the client\&. This user must have read permissions for the files that will be backed up, so it most likely needs to be \fIroot\fR\&. Optional, defaults to the value given by client\&.user in safekeep\&.conf\&.
.RE
.PP
/backup/host/@nice
.RS 4
The nice adjustment for the client\&. This settings is normally not all that important, as most of the load rests on the server side\&. NB: if you change this value, you will have to re\-deploy the auth keys\&. Optional, defaults to no nice level\&.
.RE
.PP
/backup/host/@key\-ctrl
.RS 4
This is the private key used to establish the SSH connection to the client for the control channel\&. Use of the default value is recommended\&. Optional, defaults to ~/\&.ssh/safekeep\-server\-ctrl\-key\&.
.RE
.PP
/backup/host/@key\-data
.RS 4
This is the private key used to establish the SSH connection to the client for the data channel\&. Use of the default value is recommended\&. Optional, defaults to ~/\&.ssh/safekeep\-server\-data\-key\&.
.RE
.PP
/backup/bandwidth/@overall
.RS 4
This is the client bandwidth limit for both upload and download\&. It is an integer number of KB/s (see the NOTES section in safekeep\&.conf(5) for more information)\&. Optional, overrides bandwidth\&.overall in safekeep\&.conf(5) if specified\&.
.RE
.PP
/backup/bandwidth/@download
.RS 4
This is the client bandwidth limit for download (see /backup/bandwidth/@overall for more information)\&. Optional, overrides /backup/bandwidth/@overall if specified\&.
.RE
.PP
/backup/bandwidth/@upload
.RS 4
This is the client bandwidth limit for upload (see /backup/bandwidth/@overall for more information)\&. Optional, overrides /backup/bandwidth/@overall if specified\&.
.RE
.PP
/backup/repo/@path
.RS 4
The path under which the backups will be stored\&. Relative paths are based on the \fIbase\&.dir\fR setting from the \fIsafekeep\&.conf(5)\fR\&. Since the default value for \fIbase\&.dir\fR is the user\(cqs home directory, in a typical installation the data will be stored under /var/lib/safekeep//\&. If the directory does not exist, safekeep(1) will attempt to create it automatically\&. The backup will fail altogether if the directory can not be created\&. Optional, defaults to the client ID, see /backup/@id\&. Use of the default value is \fBhighly\fR recommended\&. \fBNOTE\fR: if you must set this value explicitly, you must make sure that the path is not shared between different boxes; a shared repository path \fIwill\fR result in data loss\&.
.RE
.PP
/backup/repo/@retention
.RS 4
Specifies the duration for which the backup data will be retained\&. The incremental backup information in the destination directory that has been around longer than the retention time will be removed\&. The value specified by this attribute is an time interval: an integer followed by the character s, m, h, D, W, M, or Y, indicating seconds, minutes, hours, days, weeks, months, or years respectively, or a number of these concatenated\&. For example, 32m means 32 minutes, and 3W2D10h7s means 3 weeks, 2 days, 10 hours, and 7 seconds\&. In this context, a month means 30 days, a year is 365 days, and a day is always 86400 seconds\&. Note that backups of deleted files are covered by this operation\&. Thus if you deleted a file two weeks ago, backed up immediately afterward, and then ran safekeep(1) with a retention of \fI10D\fR today, no trace of that file would remain\&. Finally, file selection options don\(cqt affect removal of incremental data\&. Optional, defaults to empty (unlimited retention)\&.
.RE
.PP
/backup/options/special\-files/@include
.RS 4
\fBNOTE: THIS OPTION HAS BEEN DEPRECATED\&.\fR See data attributes below\&. One of "true" or "false"\&. If "true", the dump file will include all special files, including device files, fifo files and socket files\&. Optional, defaults to \fIfalse\fR\&. \fBNOTE\fR: Specification of no options is equivalent to false, but the inclusion of other options may cause the underlying backup defaults to be use\&.
.RE
.PP
/backup/options/rdiff\-backup/@append
.RS 4
Append the specified options to the current rdiff\-backup run\&. This is planned to be specific to the current rdiff\-backup, and different options will be made available for other backends\&.
.RE
.PP
/backup/options/rdiff\-backup/@exec_local
.RS 4
Executable to be run on the local host\&. Optional, defaults to \fIrdiff\-backup\fR
.RE
.PP
/backup/options/rdiff\-backup/@exec_remote
.RS 4
Executable to be run on the remote host\&. Optional, defaults to \fIrdiff\-backup\fR
.RE
.PP
/backup/setup/@writable
.RS 4
A boolean (i\&.e\&. "true" or "false") to set mount as writable or not, including snapshots and bind mounts\&. This is normally not required, and, if set, overrides the system default, but is overridden by a snapshot option\&. In general the system default is to create non\-writable mount for both snapshots and bind mounts\&. Optional for a element\&.
.RE
.PP
/backup/setup/dump/@type
.RS 4
One of "postgres" or "mysql"\&. Mandatory for a element\&.
.RE
.PP
/backup/setup/dump/@db
.RS 4
Name of the database to dump\&. If not specified, it defaults to all databases maintained in the RDBMS specified by type\&. Optional, defaults to all databases\&.
.RE
.PP
/backup/setup/dump/@save\-db\-name
.RS 4
Specify if CREATE DATABASE instructions are included in database dumps\&. If the option is not specified then the result defaults to what is natural for the default database dump function\&. If the option is "true" then CREATE DATABASE are added in all cases\&. If the option is "false" then no CREATE DATABASE statement is added\&. \fBNOTE\fR: For Postgres it is not possible to suppress the CREATE DATABASE statement when dumping all databases, i\&.e\&. no single database named, in which case this option is ignored\&. Optional, defaults to not set\&.
.RE
.PP
/backup/setup/dump/@dbuser
.RS 4
Name of the database user to use while doing the dump\&. Optional, defaults to whatever the database determines based on the system user\&.
.RE
.PP
/backup/setup/dump/@dbpasswd
.RS 4
Password of the database user to use while doing the dump\&. NB: this makes the DB password available in a plain text file\&. Make sure you use appropriate read permissions on the backup configuration file to prevent unauthorized access to the password\&. Optional, it has no default value\&.
.RE
.PP
/backup/setup/dump/@options
.RS 4
Extra options to be passed along to the dump command\&. This is database specific, and it is passed along as\-is\&. Please refer to your database documentation for possible values that you can pass along\&. Optional, it has no default value\&.
.RE
.PP
/backup/setup/dump/@user
.RS 4
The system user under which the dump should take place\&. Please note that using this feature requires that safekeep(1) runs as root on the client\&. Optional, defaults to the user under which safekeep(1) runs on the client side\&.
.RE
.PP
/backup/setup/dump/@file
.RS 4
The full path to the dump file on the client host\&. Mandatory for a element\&.
.RE
.PP
/backup/setup/dump/@cleanup
.RS 4
One of "true" or "false"\&. If "true", the dump file will be deleted from the client system once the backup is over\&. It is usually futile to delete it, since it will be created for each backup, and hence you will need to have the space available\&. Optional, defaults to \fIfalse\fR\&.
.RE
.PP
/backup/setup/snapshot/@device
.RS 4
The path (device location) to the client LVM volume to snapshot before the backup commences\&. Note that the snapshot happens on the client machines, and it ensures that the data that is being backed\-up is in a consistent state throughout the backup process\&. Multiple snapshots may be specified, in which case the order is important, the associated filesystems are mounted in the order given\&. Please note that using this feature requires that safekeep(1) runs as root on the client\&. Mandatory for a element\&.
.RE
.PP
/backup/setup/snapshot/@size
.RS 4
The size of the snapshot\&. Unallocated space must exist on the volume group\&. It is recommended that it is about 15\-20% of the original device\(cqs size\&. This can be specified as a percentage, e\&.g\&. 20%, which is equivalent to 20% of the logical volume\&. Other values as listed for lvcreate(8) can also be given\&. Optional, defaults to \fIsnapshot\&.size\fR as specified in safekeep\&.conf\&.
.RE
.PP
/backup/setup/snapshot/@tag
.RS 4
A list of tags to be added to the snapshot, with the \-\-addtag argument to lvcreate(8)\&. The @tag entry consists of a , separated list of tags\&. An @ is automatically added to each generated tag\&. Optional for a element\&.
.RE
.PP
/backup/setup/snapshot/@mountoptions
.RS 4
Mount options to be used with the snapshot device\&. This is normally not required, as the default options should suit routine usage\&. Optional for a element\&.
.RE
.PP
/backup/setup/snapshot/@writable
.RS 4
A boolean (i\&.e\&. "true" or "false") to set if snapshot mount is writable or not\&. This is normally not required, and, if set, overrides other settings from the setup option or the system default\&. Optional for a element\&.
.RE
.PP
/backup/setup/script/@path
.RS 4
Execute the script specified path on the client or server at certain steps of the backup process\&. This script is executed with four arguments:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Backup id (/backup/@id)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Backup step
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Backup root directory (valid after creation of a snapshot) for client or safekeep backup directory for server
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Run\-on parameter, i\&.e\&. \fIclient\fR or \fIserver\fR For client\-side scripts, the location optionally consists of an optional host and a mandatory path, separated by a ":", where the host part is either "client" or "server"\&. If no host part is specified then it is first looked for on the client, and if not found, then is looked for on the server\&. If it not found on either, then a warning is raised\&. Only one