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