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