xref: /original-bsd/sbin/dump/dump.8 (revision 327c59da)
1.\" Copyright (c) 1980, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)dump.8	6.11 (Berkeley) 01/25/93
7.\"
8.Dd
9.Dt DUMP 8
10.Os BSD 4
11.Sh NAME
12.Nm dump
13.Nd filesystem backup
14.Sh SYNOPSIS
15.Nm dump
16.Op Cm 0123456789fusTdWn Op Ar argument ...
17.Op Ar filesystem
18.Sh DESCRIPTION
19.Nm Dump
20examines files
21on a filesystem
22and determines which files
23need to be backed up. These files
24are copied to the given disk, tape or other
25storage medium for safe keeping (see the
26.Cm f
27option below for doing remote backups).
28A dump that is larger than the output medium is broken into
29multiple volumes.
30On most media the size is determined by writing until an
31end-of-media indication is returned.
32On media that cannot reliably return an end-of-media indication
33(such as some cartridge tape drives)
34each volume is of a fixed size;
35the actual size is determined by the tape size and density and/or
36block count options below.
37By default, the same output file name is used for each volume
38after prompting the operator to change media.
39.Pp
40The following options are supported by
41.Nm dump:
42.Bl -tag -width 4n
43.It Cm 0\-9
44Dump levels.
45A level 0, full backup,
46guarantees the entire file system is copied.
47A level number above 0,
48incremental backup,
49tells dump to
50copy all files new or modified since the
51last dump of the same or lower level. The default
52level is 9.
53.It Cm f Op Ar file
54Write the backup to
55.Ar file ;
56.Ar file
57may be a special device file
58like
59.Pa /dev/rmt12
60(a tape drive),
61.Pa /dev/rsd1c
62(a disk drive),
63an ordinary file,
64or
65.Ql Fl
66(the standard output).
67Multiple file names may be given as a single argument separated by commas.
68Each file will be used for one dump volume in the order listed;
69if the dump requires more volumes than the number of names given,
70the last file name will used for all remaining volumes after prompting
71for media changes.
72If the name of the file is of the form
73.Dq host:file ,
74or
75.Dq user@host:file ,
76.Nm dump
77writes to the named file on the remote host using
78.Xr rmt 8 .
79.It Cm d Ar density
80Set tape density to
81.Ar density .
82The default is 1600BPI.
83.It Cm n
84Whenever
85.Nm dump
86requires operator attention,
87notify all operators in the group
88.Dq operator
89by means similar to a
90.Xr wall 1 .
91.It Cm s Ar feet
92Attempt to calculate the amount of tape needed
93at a particular density.
94If this amount is exceeded,
95.Nm dump
96prompts for a new tape.
97It is recommended to be a bit conservative on this option.
98The default tape length is 2300 feet.
99.It Cm u
100Update the file
101.Pa /etc/dumpdates
102after a successful dump.
103The format of
104.Pa /etc/dumpdates
105is readable by people, consisting of one
106free format record per line:
107filesystem name,
108increment level
109and
110.Xr ctime 3
111format dump date.
112There may be only one entry per filesystem at each level.
113The file
114.Pa /etc/dumpdates
115may be edited to change any of the fields,
116if necessary.
117.It Cm T Ar date
118Use the specified date as the starting time for the dump
119instead of the time determined from looking in
120.Pa /etc/dumpdates .
121The format of date is the same as that of
122.Xr ctime 3 .
123This option is useful for automated dump scripts that wish to
124dump over a specific period of time.
125The
126.Cm T
127option is mutually exclusive from the
128.Cm u
129option.
130.It Cm W
131.Nm Dump
132tells the operator what file systems need to be dumped.
133This information is gleaned from the files
134.Pa /etc/dumpdates
135and
136.Pa /etc/fstab .
137The
138.Cm W
139option causes
140.Nm dump
141to print out, for each file system in
142.Pa /etc/dumpdates
143the most recent dump date and level,
144and highlights those file systems that should be dumped.
145If the
146.Cm W
147option is set, all other options are ignored, and
148.Nm dump
149exits immediately.
150.It Cm w
151Is like W, but prints only those filesystems which need to be dumped.
152.El
153.Pp
154.Nm Dump
155requires operator intervention on these conditions:
156end of tape,
157end of dump,
158tape write error,
159tape open error or
160disk read error (if there are more than a threshold of 32).
161In addition to alerting all operators implied by the
162.Cm n
163key,
164.Nm dump
165interacts with the operator on
166.Em dump's
167control terminal at times when
168.Nm dump
169can no longer proceed,
170or if something is grossly wrong.
171All questions
172.Nm dump
173poses
174.Em must
175be answered by typing
176.Dq yes
177or
178.Dq no ,
179appropriately.
180.Pp
181Since making a dump involves a lot of time and effort for full dumps,
182.Nm dump
183checkpoints itself at the start of each tape volume.
184If writing that volume fails for some reason,
185.Nm dump
186will,
187with operator permission,
188restart itself from the checkpoint
189after the old tape has been rewound and removed,
190and a new tape has been mounted.
191.Pp
192.Nm Dump
193tells the operator what is going on at periodic intervals,
194including usually low estimates of the number of blocks to write,
195the number of tapes it will take, the time to completion, and
196the time to the tape change.
197The output is verbose,
198so that others know that the terminal
199controlling
200.Nm dump
201is busy,
202and will be for some time.
203.Pp
204In the event of a catastrophic disk event, the time required
205to restore all the necessary backup tapes or files to disk
206can be kept to a minimum by staggering the incremental dumps.
207An efficient method of staggering incremental dumps
208to minimize the number of tapes follows:
209.Bl -bullet -offset indent
210.It
211Always start with a level 0 backup, for example:
212.Bd -literal -offset indent
213/etc/dump 0uf /dev/nrst1 /usr/src
214.Ed
215.Pp
216This should be done at set intervals, say once a month or once every two months,
217and on a set of fresh tapes that is saved forever.
218.It
219After a level 0, dumps of active file
220systems are taken on a daily basis,
221using a modified Tower of Hanoi algorithm,
222with this sequence of dump levels:
223.Bd -literal -offset indent
2243 2 5 4 7 6 9 8 9 9 ...
225.Ed
226.Pp
227For the daily dumps, it should be possible to use a fixed number of tapes
228for each day, used on a weekly basis.
229Each week, a level 1 dump is taken, and
230the daily Hanoi sequence repeats beginning with 3.
231For weekly dumps, another fixed set of tapes per dumped file system is
232used, also on a cyclical basis.
233.El
234.Pp
235After several months or so, the daily and weekly tapes should get
236rotated out of the dump cycle and fresh tapes brought in.
237.Sh FILES
238.Bl -tag -width /etc/dumpdates -compact
239.It Pa /dev/rmt8
240default tape unit to dump to
241.It Pa /etc/dumpdates
242dump date records
243.It Pa /etc/fstab
244dump table: file systems and frequency
245.It Pa /etc/group
246to find group
247.Em operator
248.El
249.Sh SEE ALSO
250.Xr restore 8 ,
251.Xr rmt 8 ,
252.Xr dump 5 ,
253.Xr fstab 5
254.Sh DIAGNOSTICS
255Many, and verbose.
256.Pp
257Dump exits with zero status on success.
258Startup errors are indicated with an exit code of 1;
259abnormal termination is indicated with an exit code of 3.
260.Sh BUGS
261.Pp
262Fewer than 32 read errors on the filesystem are ignored.
263Each reel requires a new process, so parent processes for
264reels already written just hang around until the entire tape
265is written.
266.Pp
267.Nm Dump
268with the
269.Cm W
270or
271.Cm w
272options does not report filesystems that have never been recorded
273in
274.Pa /etc/dumpdates ,
275even if listed in
276.Pa /etc/fstab .
277.Pp
278It would be nice if
279.Nm dump
280knew about the dump sequence,
281kept track of the tapes scribbled on,
282told the operator which tape to mount when,
283and provided more assistance
284for the operator running
285.Xr restore .
286.Sh HISTORY
287A
288.Nm dump
289command appeared in Version 6 AT&T UNIX.
290