]> arthur.barton.de Git - backup-script.git/blob - README.md
README.md: Add introduction and copyright information
[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_]target
71
72 Local backup directory. The backup of each system is stored in a folder named
73 like the system (see `system` variable) inside of this target directory.
74
75 *Note:* There is *no* default, you have to specify this variable, for example as
76 `default_target` in the `backups-script.conf` file!
77
78 ### [default_]ssh_args_add
79
80 Additional parameters for `ssh`. Default: none.
81
82 ### [default_]rsync_args_add
83
84 Additional parameters for `rsync`. Default: none.
85
86 ### [default_]exclude_args_add
87
88 Additional (exclude) parameters for `rsync`. Default: none.
89
90 ### [default_]compress
91
92 Enable (1) or disable (0) compression. Default: 1 (on).
93
94 ### [default_]ping
95
96 Enable (1) or disable (0) ping'ing the target system to make sure that it is
97 reachable before calling `rsync`. Default: 1 (on).
98
99 ### [default_]local
100
101 Enable (1) or disable (0) *local mode*: when local mode is in effect, `rsync` is
102 called without using `ssh`, which is a good idea when saving the local system.
103 Default: 0 (off; use ssh).
104
105 ### [default_]generations
106
107 Number of generations to keep. Default: 0 (none).
108
109 On a *btrfs* target file systems (see `target` variable), this script can
110 generate generations using *btrfs snapshots*: the script creates a new snapshot
111 named with the timestamp for each generation inside of the system directory
112 inside of the target directory.
113
114 ### [default_]job_pre_exec
115
116 Optional script to execute before `rsync` starts. Default: none.
117
118 When the `job_pre_exec` script returns an error (exit code is not 0), the backup
119 run is skipped!
120
121 ### [default_]job_post_exec
122
123 Optional script to execute after `rsync` exited. Default: none.