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