]> arthur.barton.de Git - backup-script.git/blob - README.md
Add compatibility layer for backup-pull(1) config files
[backup-script.git] / README.md
1 # Backup Script
2
3 A script for cloning systems using rsync.  
4 Copyright (c)2008-2015 Alexander Barton <alex@barton.de>
5
6
7 ## Usage
8
9 ### backup-script
10
11 Backup all or individual systems.
12
13 Usage: `backup-script [<options>] [<system> [<system> [...]]]`
14
15 Options:
16
17 - `-p`, `--progress`: Show progress, see rsync(1).
18 - `-n`, `--dry-run`: Test run only, don't copy any data.
19
20 When no *system* is given, all defined systems are used.
21
22 ### backup-script-wrapper
23
24 Backup all systems and mail the report to "root".
25
26 Usage: `backup-script-wrapper`
27
28 ### backup-status
29
30 Show information about backups.
31
32 Usage: `backup-status [-q] [<system> [<system> [...]]]`
33
34 Options:
35
36 - `-q`: *quick mode*, don't calculate backup sizes.
37
38
39 ## Configuration
40
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).
45
46 Variables in `backup-script.conf` must be prefixed with `default_` to define
47 default values for all systems.
48
49 All default can be overwritten in individual system configuration files.
50
51 For example:
52
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
56
57
58 ## Configuration Variable
59
60 ### system
61
62 System host name. Default: file name.
63
64 *Note:* There is no `default_system` variable!
65
66 ### [default_]user
67
68 Remote user. Default: `root`.
69
70 ### [default_]source_root
71
72 Remote *root* directory, must end with a slash ("/") character! Default: "/".
73
74 When saving the whole (remote) system ("/"), default excludes are set up
75 automatically, which exclude standard system directories like /sys and /proc.
76
77 ### [default_]target
78
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.
81
82 *Note:* There is *no* default, you have to specify this variable, for example as
83 `default_target` in the `backups-script.conf` file!
84
85 ### [default_]ssh_args_add
86
87 Additional parameters for `ssh`. Default: none.
88
89 ### [default_]rsync_args_add
90
91 Additional parameters for `rsync`. Default: none.
92
93 ### [default_]exclude_args_add
94
95 Additional (exclude) parameters for `rsync`. Default: none.
96
97 ### [default_]compress
98
99 Enable (1) or disable (0) compression. Default: 1 (on).
100
101 ### [default_]ping
102
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).
105
106 ### [default_]local
107
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).
111
112 ### [default_]generations
113
114 Number of generations to keep. Default: 0 (none).
115
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.
120
121 ### [default_]job_pre_exec
122
123 Optional script to execute before `rsync` starts. Default: none.
124
125 When the `job_pre_exec` script returns an error (exit code is not 0), the backup
126 run is skipped!
127
128 ### [default_]job_post_exec
129
130 Optional script to execute after `rsync` exited. Default: none.
131
132 ### Compatibility Variables
133
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:
136
137 * host -> system
138 * source -> source_root
139 * pre_exec -> job_pre_exec
140 * post_exec -> job_post_exec