]> git.wh0rd.org - dump.git/blame - dump/dump.8
Version 0.4b5.
[dump.git] / dump / dump.8
CommitLineData
1227625a
SP
1.\" Copyright (c) 1980, 1991, 1993
2.\" Regents of the University of California.
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\" notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\" notice, this list of conditions and the following disclaimer in the
12.\" documentation and/or other materials provided with the distribution.
13.\" 3. All advertising materials mentioning features or use of this software
b45f51d6 14.\" must display the following acknowledgment:
1227625a
SP
15.\" This product includes software developed by the University of
16.\" California, Berkeley and its contributors.
17.\" 4. Neither the name of the University nor the names of its contributors
18.\" may be used to endorse or promote products derived from this software
19.\" without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\" @(#)dump.8 8.3 (Berkeley) 5/1/95
b45f51d6 34.\" $Id: dump.8,v 1.2 1999/10/11 12:53:21 stelian Exp $
1227625a
SP
35.\"
36.Dd May 1, 1995
37.Dt DUMP 8
38.Os BSD 4
39.Sh NAME
40.Nm dump
41.Nd filesystem backup
42.Sh SYNOPSIS
43.Nm dump
b45f51d6 44.Op Fl 0123456789acknu
1227625a
SP
45.Op Fl B Ar records
46.Op Fl b Ar blocksize
47.Op Fl d Ar density
48.Op Fl f Ar file
49.Op Fl h Ar level
b45f51d6 50.Op Fl L Ar label
1227625a
SP
51.Op Fl s Ar feet
52.Op Fl T Ar date
53.Ar filesystem
54.Nm dump
b45f51d6 55.Op Fl 0123456789acknu
1227625a
SP
56.Op Fl B Ar records
57.Op Fl b Ar blocksize
58.Op Fl d Ar density
59.Op Fl f Ar file
60.Op Fl h Ar level
b45f51d6 61.Op Fl L Ar label
1227625a
SP
62.Op Fl s Ar feet
63.Op Fl T Ar date
64.Ar directory
65.Nm dump
66.Op Fl W Li \&| Fl w
67.Pp
68.in -\\n(iSu
69(The
70.Bx 4.3
71option syntax is implemented for backward compatibility, but
72is not documented here.)
73.Sh DESCRIPTION
74.Nm Dump
75examines files
76on a filesystem
77and determines which files
78need to be backed up. These files
79are copied to the given disk, tape or other
80storage medium for safe keeping (see the
81.Fl f
82option below for doing remote backups).
83A dump that is larger than the output medium is broken into
84multiple volumes.
85On most media the size is determined by writing until an
b45f51d6
SP
86end-of-media indication is returned. This can be enforced
87by using the
88.Fl a
89option.
90.Pp
1227625a
SP
91On media that cannot reliably return an end-of-media indication
92(such as some cartridge tape drives)
93each volume is of a fixed size;
94the actual size is determined by the tape size and density and/or
95block count options below.
96By default, the same output file name is used for each volume
97after prompting the operator to change media.
98.Pp
99The following options are supported by
b45f51d6 100.Nm Ns :
1227625a
SP
101.Bl -tag -width Ds
102.It Fl 0\-9
103Dump levels.
104A level 0, full backup,
105guarantees the entire file system is copied
106(but see also the
107.Fl h
108option below).
109A level number above 0,
110incremental backup,
111tells dump to
112copy all files new or modified since the
b45f51d6
SP
113last dump of any lower level.
114The default level is 0.
1227625a 115.It Fl B Ar records
b45f51d6 116The number of 1 KB blocks per volume.
1227625a
SP
117This option overrides the calculation of tape size
118based on length and density.
b45f51d6
SP
119.It Fl a
120.Dq auto-size .
121Bypass all tape length considerations, and enforce writing
122until an end-of-media indication is returned. This fits best
123for most modern tape drives. Use of this option is particularly
124recommended when appending to an existing tape, or using a tape
125drive with hardware compression (where you can never be sure about
126the compression ratio).
1227625a
SP
127.It Fl b Ar blocksize
128The number of kilobytes per dump record.
129.It Fl c
b45f51d6
SP
130Change the defaults for use with a cartridge tape drive, with a density
131of 8000 bpi, and a length of 1700 feet.
132.It Fl h Ar level
133Honor the user
134.Dq nodump
135flag
136.Dp Dv UF_NODUMP
137only for dumps at or above the given
138.Ar level .
139The default honor level is 1,
140so that incremental backups omit such files
141but full backups retain them.
1227625a
SP
142.It Fl d Ar density
143Set tape density to
144.Ar density .
145The default is 1600BPI.
146.It Fl f Ar file
147Write the backup to
148.Ar file ;
149.Ar file
150may be a special device file
151like
152.Pa /dev/rmt12
153(a tape drive),
154.Pa /dev/rsd1c
b45f51d6 155(a floppy disk drive),
1227625a
SP
156an ordinary file,
157or
158.Ql Fl
159(the standard output).
160Multiple file names may be given as a single argument separated by commas.
161Each file will be used for one dump volume in the order listed;
162if the dump requires more volumes than the number of names given,
163the last file name will used for all remaining volumes after prompting
164for media changes.
165If the name of the file is of the form
166.Dq host:file ,
167or
168.Dq user@host:file ,
b45f51d6 169.Nm
1227625a
SP
170writes to the named file on the remote host using
171.Xr rmt 8 .
b45f51d6
SP
172The default path name of the remote
173.Xr rmt 8
174program is
175.\" rmt path, is the path on the remote host
176.Pa /etc/rmt ;
177this can be overridden by the environment variable
178.Ev RMT .
179.It Fl k
180Use Kerberos authentication to talk to remote tape servers. (Only
181available if this option was enabled when
182.Nm
183was compiled.)
184.It Fl L Ar label
185The user-supplied text string
186.Ar label
187is placed into the dump header, where tools like
188.Xr restore 8
189and
190.Xr file 1
191can access it.
192Note that this label is limited
193to be at most LBLSIZE (currently 16) characters, which must include
194the terminating
195.Ql \e0 .
1227625a
SP
196.It Fl n
197Whenever
b45f51d6 198.Nm
1227625a
SP
199requires operator attention,
200notify all operators in the group
201.Dq operator
202by means similar to a
203.Xr wall 1 .
204.It Fl s Ar feet
205Attempt to calculate the amount of tape needed
206at a particular density.
207If this amount is exceeded,
b45f51d6 208.Nm
1227625a
SP
209prompts for a new tape.
210It is recommended to be a bit conservative on this option.
211The default tape length is 2300 feet.
212.ne 1i
213.It Fl T Ar date
214Use the specified date as the starting time for the dump
215instead of the time determined from looking in
216.Pa /etc/dumpdates .
217The format of date is the same as that of
218.Xr ctime 3 .
219This option is useful for automated dump scripts that wish to
220dump over a specific period of time.
221The
222.Fl T
223option is mutually exclusive from the
224.Fl u
225option.
226.It Fl u
227Update the file
228.Pa /etc/dumpdates
229after a successful dump.
230The format of
231.Pa /etc/dumpdates
232is readable by people, consisting of one
233free format record per line:
234filesystem name,
235increment level
236and
237.Xr ctime 3
238format dump date.
239There may be only one entry per filesystem at each level.
240The file
241.Pa /etc/dumpdates
242may be edited to change any of the fields,
243if necessary.
244.It Fl W
245.Nm Dump
246tells the operator what file systems need to be dumped.
247This information is gleaned from the files
248.Pa /etc/dumpdates
249and
250.Pa /etc/fstab .
251The
252.Fl W
253option causes
b45f51d6 254.Nm
1227625a
SP
255to print out, for each file system in
256.Pa /etc/dumpdates
257the most recent dump date and level,
258and highlights those file systems that should be dumped.
259If the
260.Fl W
261option is set, all other options are ignored, and
b45f51d6 262.Nm
1227625a
SP
263exits immediately.
264.It Fl w
265Is like W, but prints only those filesystems which need to be dumped.
266.El
267.Pp
268.Nm Dump
269requires operator intervention on these conditions:
270end of tape,
271end of dump,
272tape write error,
273tape open error or
274disk read error (if there are more than a threshold of 32).
275In addition to alerting all operators implied by the
276.Fl n
277key,
b45f51d6 278.Nm
1227625a
SP
279interacts with the operator on
280.Em dump's
281control terminal at times when
b45f51d6 282.Nm
1227625a
SP
283can no longer proceed,
284or if something is grossly wrong.
285All questions
b45f51d6 286.Nm
1227625a
SP
287poses
288.Em must
289be answered by typing
290.Dq yes
291or
292.Dq no ,
293appropriately.
294.Pp
295Since making a dump involves a lot of time and effort for full dumps,
b45f51d6 296.Nm
1227625a
SP
297checkpoints itself at the start of each tape volume.
298If writing that volume fails for some reason,
b45f51d6 299.Nm
1227625a
SP
300will,
301with operator permission,
302restart itself from the checkpoint
303after the old tape has been rewound and removed,
304and a new tape has been mounted.
305.Pp
306.Nm Dump
307tells the operator what is going on at periodic intervals,
308including usually low estimates of the number of blocks to write,
309the number of tapes it will take, the time to completion, and
310the time to the tape change.
311The output is verbose,
312so that others know that the terminal
313controlling
b45f51d6 314.Nm
1227625a
SP
315is busy,
316and will be for some time.
317.Pp
318In the event of a catastrophic disk event, the time required
319to restore all the necessary backup tapes or files to disk
320can be kept to a minimum by staggering the incremental dumps.
321An efficient method of staggering incremental dumps
322to minimize the number of tapes follows:
323.Bl -bullet -offset indent
324.It
325Always start with a level 0 backup, for example:
326.Bd -literal -offset indent
327/sbin/dump -0u -f /dev/nrst1 /usr/src
328.Ed
329.Pp
330This should be done at set intervals, say once a month or once every two months,
331and on a set of fresh tapes that is saved forever.
332.It
333After a level 0, dumps of active file
334systems are taken on a daily basis,
335using a modified Tower of Hanoi algorithm,
336with this sequence of dump levels:
337.Bd -literal -offset indent
3383 2 5 4 7 6 9 8 9 9 ...
339.Ed
340.Pp
341For the daily dumps, it should be possible to use a fixed number of tapes
342for each day, used on a weekly basis.
343Each week, a level 1 dump is taken, and
344the daily Hanoi sequence repeats beginning with 3.
345For weekly dumps, another fixed set of tapes per dumped file system is
346used, also on a cyclical basis.
347.El
348.Pp
349After several months or so, the daily and weekly tapes should get
350rotated out of the dump cycle and fresh tapes brought in.
b45f51d6
SP
351.Sh ENVIRONMENT
352.Bl -tag -width Fl
353.It Ev TAPE
354If no -f option was specified,
355.Nm
356will use the device specified via
357.Ev TAPE
358as the dump device.
359.Ev TAPE
360may be of the form
361.Qq tapename ,
362.Qq host:tapename ,
363or
364.Qq user@host:tapename .
365.It Ev RMT
366The environment variable
367.Ev RMT
368will be used to determine the pathname of the remote
369.Xr rmt 8
370program.
1227625a
SP
371.Sh FILES
372.Bl -tag -width /etc/dumpdates -compact
373.It Pa /dev/rmt8
374default tape unit to dump to
375.It Pa /etc/dumpdates
376dump date records
377.It Pa /etc/fstab
378dump table: file systems and frequency
379.It Pa /etc/group
380to find group
381.Em operator
382.El
383.Sh SEE ALSO
b45f51d6 384.Xr fstab 5 ,
1227625a 385.Xr restore 8 ,
b45f51d6 386.Xr rmt 8
1227625a
SP
387.Sh DIAGNOSTICS
388Many, and verbose.
389.Pp
390Dump exits with zero status on success.
391Startup errors are indicated with an exit code of 1;
392abnormal termination is indicated with an exit code of 3.
393.Sh BUGS
394Fewer than 32 read errors on the filesystem are ignored.
395.Pp
396Each reel requires a new process, so parent processes for
397reels already written just hang around until the entire tape
398is written.
399.Pp
400.Nm Dump
401with the
402.Fl W
403or
404.Fl w
405options does not report filesystems that have never been recorded
406in
407.Pa /etc/dumpdates ,
408even if listed in
409.Pa /etc/fstab .
410.Pp
411It would be nice if
b45f51d6 412.Nm
1227625a
SP
413knew about the dump sequence,
414kept track of the tapes scribbled on,
415told the operator which tape to mount when,
416and provided more assistance
417for the operator running
418.Xr restore .
b45f51d6
SP
419.Pp
420.Nm Dump
421cannot do remote backups without being run as root, due to its
422security history. This will be fixed in a later version of
423.Bx Free .
424Presently, it works if you set it setuid (like it used to be), but this
425might constitute a security risk.
1227625a
SP
426.Sh HISTORY
427A
b45f51d6
SP
428.Nm
429command appeared in
430.At v6 .