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