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 used.
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 defauklt configuration variables are read from `/etc/backup-script.conf`,
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).
46 Variables in `backup-script.conf` must be prefixed with `default_` to define
47 default values for all systems.
49 All default can be overwritten in individual system configuration files.
53 - `/etc/backups-script.conf`: defaults for all hosts
54 - `/etc/backups-script.d/host01.example.net`: configuration for host 1
55 - `/etc/backups-script.d/clientXY.example.com`: configuration for host 2
58 ## Configuration Variable
62 System host name. Default: file name.
64 *Note:* There is no `default_system` variable!
68 Remote user. Default: `root`.
70 ### [default_]source_root
72 Remote *root* directory, must end with a slash ("/") character! Default: "/".
74 When saving the whole (remote) system ("/"), default excludes are set up
75 automatically, which exclude standard system directories like /sys and /proc.
79 Local backup directory. The backup of each system is stored in a folder named
80 like the system (see `system` variable) inside of this target directory.
82 *Note:* There is *no* default, you have to specify this variable, for example as
83 `default_target` in the `backups-script.conf` file!
85 ### [default_]ssh_args_add
87 Additional parameters for `ssh`. Default: none.
89 ### [default_]rsync_args_add
91 Additional parameters for `rsync`. Default: none.
93 ### [default_]exclude_args_add
95 Additional (exclude) parameters for `rsync`. Default: none.
97 ### [default_]compress
99 Enable (1) or disable (0) compression. Default: 1 (on).
103 Enable (1) or disable (0) ping'ing the target system to make sure that it is
104 reachable before calling `rsync`. Default: 1 (on).
108 Enable (1) or disable (0) *local mode*: when local mode is in effect, `rsync` is
109 called without using `ssh`, which is a good idea when saving the local system.
110 Default: 0 (off; use ssh).
112 ### [default_]generations
114 Number of generations to keep. Default: 0 (none).
116 On a *btrfs* target file systems (see `target` variable), this script can
117 generate generations using *btrfs snapshots*: the script creates a new snapshot
118 named with the timestamp for each generation inside of the system directory
119 inside of the target directory.
121 ### [default_]job_pre_exec
123 Optional script to execute before `rsync` starts. Default: none.
125 When the `job_pre_exec` script returns an error (exit code is not 0), the backup
128 ### [default_]job_post_exec
130 Optional script to execute after `rsync` exited. Default: none.
132 ### Compatibility Variables
134 The following configurations variables used by the backup-pull(1) script in job
135 definition files are automatically mapped to the new backup-script variables:
138 * source -> source_root
139 * pre_exec -> job_pre_exec
140 * post_exec -> job_post_exec