Debian Codegraph @

manpages/cback3.1

raw
1 .\" vim: set ft=nroff .\"
2 .\" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
3 .\" #
4 .\" # C E D A R
5 .\" # S O L U T I O N S "Software done right."
6 .\" # S O F T W A R E
7 .\" #
8 .\" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
9 .\" #
10 .\" # Author : Kenneth J. Pronovici <[email protected]>
11 .\" # Language : nroff
12 .\" # Project : Cedar Backup, release 3
13 .\" # Purpose : Manpage for cback3 script
14 .\" #
15 .\" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
16 .\"
17 .TH cback3 "1" "Aug 2019" "Cedar Backup 3" "Kenneth J. Pronovici"
18 .SH NAME
19 cback3 \- Local and remote backups to CD or DVD media or Amazon S3 storage
20 .SH SYNOPSIS
21 .B cback3
22 [\fIswitches\fR]
23 action(s)
24 .SH DESCRIPTION
25 .PP
26 The cback3 script provides the command\-line interface for Cedar Backup 3.
27 Cedar Backup 3 is a software package designed to manage system backups for a
28 pool of local and remote machines. It understands how to back up filesystem
29 data as well as MySQL and PostgreSQL databases and Subversion repositories. It
30 can also be easily extended to support other kinds of data sources.
31 .PP
32 Cedar Backup 3 is focused around weekly backups to a single CD or DVD disc,
33 with the expectation that the disc will be changed or overwritten at the
34 beginning of each week. If your hardware is new enough, Cedar Backup can
35 write multisession discs, allowing you to add incremental data to a disc on
36 a daily basis.
37 .PP
38 Alternately, Cedar Backup 3 can write your backups to the Amazon S3 cloud
39 rather than relying on physical media.
40 .SH BACKUP CONCEPTS
41 .PP
42 There are two kinds of machines in a Cedar Backup pool. One machine (the
43 \fImaster\fR) has a CD or DVD writer on it and is where the backup is
44 written to disc. The others (\fIclients\fR) collect data to be written to disc
45 by the master. Collectively, the master and client machines in a pool are all
46 referred to as \fIpeer\fR machines. There are four actions that take place as
47 part of the backup process: \fIcollect\fR, \fIstage\fR, \fIstore\fR and
48 \fIpurge\fR. Both the master and the clients execute the collect and purge
49 actions, but only the master executes the stage and store actions. The
50 configuration file \fI/etc/cback3.conf\fR controls the actions taken during
51 the collect, stage, store and purge actions.
52 .PP
53 Cedar Backup also supports the concept of \fImanaged clients\fR. Managed
54 clients have their entire backup process managed by the master via a remote
55 shell. The same actions are run as part of the backup process, but the master
56 controls when the actions are executed on the clients rather than the clients
57 controlling it for themselves. This facility is intended for use in
58 environments where a scheduler like cron is not available.
59 .SH MIGRATING FROM VERSION 2 TO VERSION 3
60 .PP
61 The main difference between Cedar Backup version 2 and Cedar Backup version 3
62 is the targeted Python interpreter. Cedar Backup version 2 was designed for
63 Python 2, while version 3 is a conversion of the original code to Python 3.
64 Other than that, both versions are functionally equivalent. The configuration
65 format is unchanged, and you can mix\-and\-match masters and clients of different
66 versions in the same backup pool. Both versions will be fully supported until
67 around the time of the Python 2 end\-of\-life in 2020, but you should plan to
68 migrate sooner than that if possible.
69 .PP
70 A major design goal for version 3 was to facilitate easy migration testing for
71 users, by making it possible to install version 3 on the same server where
72 version 2 was already in use. A side effect of this design choice is that all
73 of the executables, configuration files, and logs changed names in version
74 3. Where version 2 used \fIcback\fR, version 3 uses \fIcback3\fR:
75 \fIcback3.conf\fR instead of \fIcback.conf\fR, \fIcback3.log\fR instead of
76 \fIcback.log\fR, etc.
77 .PP
78 So, while migrating from version 2 to version 3 is relatively
79 straightforward, you will have to make some changes manually. You will need to
80 create a new configuration file (or soft link to the old one), modify your cron
81 jobs to use the new executable name, etc. You can migrate one server at a time
82 in your pool with no ill effects, or even incrementally migrate a single server
83 by using version 2 and version 3 on different days of the week or for different
84 parts of the backup.
85 .SH SWITCHES
86 .TP
87 \fB\-h\fR, \fB\-\-help\fR
88 Display usage/help listing.
89 .TP
90 \fB\-V\fR, \fB\-\-version\fR
91 Display version information.
92 .TP
93 \fB\-b\fR, \fB\-\-verbose\fR
94 Print verbose output to the screen as well writing to the logfile. When this
95 option is enabled, most information that would normally be written to the
96 logfile will also be written to the screen.
97 .TP
98 \fB\-q\fR, \fB\-\-quiet\fR
99 Run quietly (display no output to the screen).
100 .TP
101 \fB\-c\fR, \fB\-\-config\fR
102 Specify the path to an alternate configuration file. The default configuration
103 file is \fI/etc/cback3.conf\fR.
104 .TP
105 \fB\-f\fR, \fB\-\-full\fR
106 Perform a full backup, regardless of configuration. For the collect action,
107 this means that any existing information related to incremental backups will be
108 ignored and rewritten; for the store action, this means that a new disc will be
109 started.
110 .TP
111 \fB\-M\fR, \fB\-\-managed\fR
112 Include managed clients when executing actions. If the action being executed
113 is listed as a managed action for a managed client, execute the action on that
114 client after executing the action locally.
115 .TP
116 \fB\-N\fR, \fB\-\-managed-only\fR
117 Include only managed clients when executing actions. If the action being
118 executed is listed as a managed action for a managed client, execute the action
119 on that client, but do not execute the action locally.
120 .TP
121 \fB\-l\fR, \fB\-\-logfile\fR
122 Specify the path to an alternate logfile. The default logfile file is
123 \fI/var/log/cback3.log\fR.
124 .TP
125 \fB\-o\fR, \fB\-\-owner\fR
126 Specify the ownership of the logfile, in the form user:group. The default
127 ownership is \fIroot:adm\fR, to match the Debian standard for most logfiles. This
128 value will only be used when creating a new logfile. If the logfile already
129 exists when the cback3 script is executed, it will retain its existing ownership
130 and mode. Only user and group names may be used, not numeric uid and gid
131 values.
132 .TP
133 \fB\-m\fR, \fB\-\-mode\fR
134 Specify the permissions for the logfile, using the numeric mode as in chmod(1).
135 The default mode is \fI640\fR (\-rw\-r\-\-\-\-\-). This value will only be used when
136 creating a new logfile. If the logfile already exists when the cback3 script is
137 executed, it will retain its existing ownership and mode.
138 .TP
139 \fB\-O\fR, \fB\-\-output\fR
140 Record some sub-command output to the logfile. When this option is enabled, all
141 output from system commands will be logged. This might be useful for debugging
142 or just for reference.
143 .TP
144 \fB\-d\fR, \fB\-\-debug\fR
145 Write debugging information to the logfile. This option produces a high volume
146 of output, and would generally only be needed when debugging a problem. This
147 option implies the \-\-output option, as well.
148 .TP
149 \fB\-s\fR, \fB\-\-stack\fR
150 Dump a Python stack trace instead of swallowing exceptions. This forces Cedar
151 Backup to dump the entire Python stack trace associated with an error, rather
152 than just propagating last message it received back up to the user interface.
153 Under some circumstances, this is useful information to include along with a
154 bug report.
155 .TP
156 \fB\-D\fR, \fB\-\-diagnostics\fR
157 Display runtime diagnostic information and then exit. This diagnostic
158 information is often useful when filing a bug report.
159 .SH ACTIONS
160 .TP
161 \fBall\fR
162 Take all normal actions (collect, stage, store, purge), in that order.
163 .TP
164 \fBcollect\fR
165 Take the collect action, creating tarfiles for each directory specified in the
166 collect section of the configuration file.
167 .TP
168 \fBstage\fR
169 Take the stage action, copying tarfiles from each peer in the backup pool to
170 the daily staging directory, based on the stage section of the configuration
171 file.
172 .TP
173 \fBstore\fR
174 Take the store action, writing the daily staging directory to disc based on the
175 store section of the configuration file.
176 .TP
177 \fBpurge\fR
178 Take the purge action, removing old and outdated files as specified in the
179 purge section of the configuration file.
180 .TP
181 \fBrebuild\fR
182 The rebuild action attempts to rebuild "this week's" disc from any remaining
183 unpurged staging directories. Typically, it is used to make a copy of a
184 backup, replace lost or damaged media, or to switch to new media mid-week for
185 some other reason.
186 .TP
187 \fBvalidate\fR
188 Ensure that configuration is valid, but take no other action. Validation
189 checks that the configuration file can be found and can be parsed, and also
190 checks for typical configuration problems, such as directories that are not
191 writable or problems with the target SCSI device.
192 .SH RETURN VALUES
193 .PP
194 Cedar Backup returns 0 (zero) upon normal completion, and six other error
195 codes related to particular errors.
196 .TP
197 \fB1\fR
198 The Python interpreter version is not supported.
199 .TP
200 \fB2\fR
201 Error processing command\-line arguments.
202 .TP
203 \fB3\fR
204 Error configuring logging.
205 .TP
206 \fB4\fR
207 Error parsing indicated configuration file.
208 .TP
209 \fB5\fR
210 Backup was interrupted with a CTRL\-C or similar.
211 .TP
212 \fB6\fR
213 Error executing specified backup actions.
214 .SH NOTES
215 .PP
216 The script is designed to run as root, since otherwise it's difficult to back
217 up system directories or write the CD or DVD device. However, pains are taken
218 to switch to a backup user (specified in configuration) when appropriate.
219 .PP
220 To use the script, you must specify at least one action to take. More than one
221 of the "collect", "stage", "store" or "purge" actions may be specified, in any
222 arbitrary order. The "all", "rebuild" or "validate" actions may not be
223 combined with other actions. If more than one action is specified, then
224 actions will be taken in a sensible order (generally collect, followed by
225 stage, followed by store, followed by purge).
226 .PP
227 If you have configured any Cedar Backup extensions, then the actions associated
228 with those extensions may also be specified on the command line. If you specify
229 any other actions along with an extended action, the actions will be executed
230 in a sensible order per configuration. However, the "all" action never executes
231 extended actions.
232 .PP
233 Note that there is no facility for restoring backups. It is assumed that the
234 user can deal with copying tarfiles off disc and using them to restore missing
235 files as needed. The user manual provides detailed instructions in Appendix C.
236 .PP
237 Finally, you should be aware that backups to CD or DVD can probably be read
238 by any user which has permissions to mount the CD or DVD drive. If you
239 intend to leave the backup disc in the drive at all times, you may want to
240 consider this when setting up device permissions on your machine. You might
241 also want to investigate the encrypt extension.
242 .SH FILES
243 .TP
244 \fI/etc/cback3.conf\fR - Default configuration file
245 .TP
246 \fI/var/log/cback3.log\fR - Default log file
247 .SH URLS
248 .TP
249 The project homepage is: \fIhttps://github.com/pronovic/cedar\-backup3\fR
250 .SH BUGS
251 .PP
252 There probably are bugs in this code. However, it is in active use for my own
253 backups, and I fix problems as I notice them. If you find a bug, please report
254 it.
255 .PP
256 If possible, give me the output from \-\-diagnostics, all of the error
257 messages that the script printed into its log, and also any stack\-traces
258 (exceptions) that Python printed. It would be even better if you could tell me
259 how to reproduce the problem, for instance by sending me your configuration file.
260 .PP
261 Report bugs to <support@cedar\-solutions.com> or via GitHub issues
262 tracker.
263 .SH AUTHOR
264 Written and maintained by Kenneth J. Pronovici <[email protected]> with contributions from others.
265 .SH COPYRIGHT
266 Copyright (c) 2004\-2020 Kenneth J. Pronovici.
267 .PP
268 This is free software; see the source for copying conditions. There is
269 NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
270 PURPOSE.