]> arthur.barton.de Git - backup-script.git/blob - README.md
Add README.md file
[backup-script.git] / README.md
1 # Backup Script
2
3
4 ## Usage
5
6 ### backup-script
7
8 Backup all or individual systems.
9
10 Usage: `backup-script [<options>] [<system> [<system> [...]]]`
11
12 Options:
13
14 - `-p`, `--progress`: Show progress, see rsync(1).
15 - `-n`, `--dry-run`: Test run only, don't copy any data.
16
17 When no *system* is given, all defined systems are used.
18
19 ### backup-script-wrapper
20
21 Backup all systems and mail the report to "root".
22
23 Usage: `backup-script-wrapper`
24
25 ### backup-status
26
27 Show information about backups.
28
29 Usage: `backup-status [-q] [<system> [<system> [...]]]`
30
31 Options:
32
33 - `-q`: *quick mode*, don't calculate backup sizes.
34
35
36 ## Configuration
37
38 All defauklt configuration variables are read from `/etc/backup-script.conf`,
39 from `/etc/backup-script.d/backup-script.conf` (deprecated). The individual
40 systems are configured using individual files in `/etc/backup-script.d/`, one
41 for each system to backup (files ending in `*.sh` are skipped).
42
43 Variables in `backup-script.conf` must be prefixed with `default_` to define
44 default values for all systems.
45
46 All default can be overwritten in individual system configuration files.
47
48 For example:
49
50 - `/etc/backups-script.conf`: defaults for all hosts
51 - `/etc/backups-script.d/host01.example.net`: configuration for host 1
52 - `/etc/backups-script.d/clientXY.example.com`: configuration for host 2
53
54
55 ## Configuration Variable
56
57 ### system
58
59 System host name. Default: file name.
60
61 *Note:* There is no `default_system` variable!
62
63 ### [default_]user
64
65 Remote user. Default: `root`.
66
67 ### [default_]target
68
69 Local backup directory. The backup of each system is stored in a folder named
70 like the system (see `system` variable) inside of this target directory.
71
72 *Note:* There is *no* default, you have to specify this variable, for example as
73 `default_target` in the `backups-script.conf` file!
74
75 ### [default_]ssh_args_add
76
77 Additional parameters for `ssh`. Default: none.
78
79 ### [default_]rsync_args_add
80
81 Additional parameters for `rsync`. Default: none.
82
83 ### [default_]exclude_args_add
84
85 Additional (exclude) parameters for `rsync`. Default: none.
86
87 ### [default_]compress
88
89 Enable (1) or disable (0) compression. Default: 1 (on).
90
91 ### [default_]ping
92
93 Enable (1) or disable (0) ping'ing the target system to make sure that it is
94 reachable before calling `rsync`. Default: 1 (on).
95
96 ### [default_]local
97
98 Enable (1) or disable (0) *local mode*: when local mode is in effect, `rsync` is
99 called without using `ssh`, which is a good idea when saving the local system.
100 Default: 0 (off; use ssh).
101
102 ### [default_]generations
103
104 Number of generations to keep. Default: 0 (none).
105
106 On a *btrfs* target file systems (see `target` variable), this script can
107 generate generations using *btrfs snapshots*: the script creates a new snapshot
108 named with the timestamp for each generation inside of the system directory
109 inside of the target directory.
110
111 ### [default_]job_pre_exec
112
113 Optional script to execute before `rsync` starts. Default: none.
114
115 When the `job_pre_exec` script returns an error (exit code is not 0), the backup
116 run is skipped!
117
118 ### [default_]job_post_exec
119
120 Optional script to execute after `rsync` exited. Default: none.