3 A script for cloning systems using rsync.
4 Copyright (c)2008-2015 Alexander Barton <alex@barton.de>
11 Backup all or individual systems.
13 Usage: `backup-script [<options>] [<system> [<system> [...]]]`
17 - `-p`, `--progress`: Show progress, see rsync(1).
18 - `-n`, `--dry-run`: Test run only, don't copy any data.
20 When no *system* is given, all defined systems are backed up.
22 ### backup-script-wrapper
24 Backup all systems and mail the report to "root".
26 Usage: `backup-script-wrapper`
30 Show information about backups.
32 Usage: `backup-status [-q] [<system> [<system> [...]]]`
36 - `-q`: *quick mode*, don't calculate backup sizes.
41 All default configuration variables are read from `/etc/backup-script.conf` or
42 from `/etc/backup-script.d/backup-script.conf` (deprecated). The individual
43 systems are configured using individual files in `/etc/backup-script.d/`, one
44 for each system to backup (files ending in `*.sh` are skipped, as well as
45 files named `backup-script.conf`). Please avoid spaces and other "special"
48 Variables in `backup-script.conf` must be prefixed with `default_` to define
49 default values for all systems.
51 All defaults can be overwritten in individual system configuration files.
55 - `/etc/backups-script.conf`: defaults for all hosts
56 - `/etc/backups-script.d/host01.example.net`: configuration for host 1
57 - `/etc/backups-script.d/clientXY.example.com`: configuration for host 2
60 ## Configuration Variables
64 System host name. Default: file name.
66 *Note:* There is no `default_system` variable!
70 Remote user. Default: `root`.
72 ### [default_]source_root
74 Remote *root* directory, must end with a slash ("/") character! Default: "/".
76 When saving the whole (remote) system ("/"), default excludes are set up
77 automatically, which exclude standard system directories like /sys and /proc.
81 Local backup directory. The backup of each system is stored in a folder named
82 like the system (see `system` variable) inside of this target directory.
84 *Note:* There is *no* default, you have to specify this variable, for example as
85 `default_target` in the `backups-script.conf` file!
87 ### [default_]ssh_args_add
89 Additional parameters for `ssh`. Default: none.
91 ### [default_]rsync_args_add
93 Additional parameters for `rsync`. Default: none.
95 ### [default_]exclude_args_add
97 Additional (exclude) parameters for `rsync`. Default: none.
99 ### [default_]compress
101 Enable (1) or disable (0) compression. Default: 1 (on).
105 Enable (1) or disable (0) ping'ing the target system to make sure that it is
106 reachable before calling `rsync`. Default: 1 (on).
110 Enable (1) or disable (0) *local mode*: when local mode is in effect, `rsync` is
111 called without using `ssh`, which is a good idea when saving the local system.
112 Default: 0 (off; use ssh).
114 ### [default_]generations
116 Number of generations to keep. Default: 0 (none).
118 On a suitable target file systems (see `target` variable), this script can
119 generate generations using snapshots: the script creates a new snapshot
120 named with the time stamp for each generation inside of the system directory
121 inside of the target directory.
123 Supported file systems are:
126 All generations are btrfs subvolumes and named after the date and time.
128 All generations are ZFS file systems. Latest generation is named `current`,
129 elders are links to the ZFS snapshot directories.
131 The latest snapshot is always reachable using a symlink named `latest`
132 inside the system directory.
134 ### [default_]job_pre_exec
136 Optional script to execute before `rsync` starts. Default: none.
138 When the `job_pre_exec` script returns an error (exit code is not 0), the backup
141 ### [default_]job_post_exec
143 Optional script to execute after `rsync` exited. Default: none.
145 ### Compatibility Variables
147 The following configurations variables used by the backup-pull(1) script in job
148 definition files are automatically mapped to the new backup-script variables:
151 * source -> source_root
152 * pre_exec -> job_pre_exec
153 * post_exec -> job_post_exec