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/rst0 106(a tape drive), 107.Pa /dev/rfd1 108(a floppy 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 . 125The default path name of the remote 126.Xr rmt 8 127program is 128.\" rmt path, is the path on the remote host 129.Pa /etc/rmt ; 130this can be overridden by the environment variable 131.Ev RMT . 132.It Cm d Ar density 133Set tape density to 134.Ar density . 135The default is 1600BPI. 136.It Cm n 137Whenever 138.Nm dump 139requires operator attention, 140notify all operators in the group 141.Dq operator 142by means similar to a 143.Xr wall 1 . 144.It Cm s Ar feet 145Attempt to calculate the amount of tape needed 146at a particular density. 147If this amount is exceeded, 148.Nm dump 149prompts for a new tape. 150It is recommended to be a bit conservative on this option. 151The default tape length is 2300 feet. 152.It Cm u 153Update the file 154.Pa /etc/dumpdates 155after a successful dump. 156The format of 157.Pa /etc/dumpdates 158is readable by people, consisting of one 159free format record per line: 160filesystem name, 161increment level 162and 163.Xr ctime 3 164format dump date. 165There may be only one entry per filesystem at each level. 166The file 167.Pa /etc/dumpdates 168may be edited to change any of the fields, 169if necessary. 170.It Cm T Ar date 171Use the specified date as the starting time for the dump 172instead of the time determined from looking in 173.Pa /etc/dumpdates . 174The format of date is the same as that of 175.Xr ctime 3 . 176This option is useful for automated dump scripts that wish to 177dump over a specific period of time. 178The 179.Cm T 180option is mutually exclusive from the 181.Cm u 182option. 183.It Cm W 184.Nm Dump 185tells the operator what file systems need to be dumped. 186This information is gleaned from the files 187.Pa /etc/dumpdates 188and 189.Pa /etc/fstab . 190The 191.Cm W 192option causes 193.Nm dump 194to print out, for each file system in 195.Pa /etc/dumpdates 196the most recent dump date and level, 197and highlights those file systems that should be dumped. 198If the 199.Cm W 200option is set, all other options are ignored, and 201.Nm dump 202exits immediately. 203.It Cm w 204Is like W, but prints only those filesystems which need to be dumped. 205.El 206.Pp 207.Nm Dump 208requires operator intervention on these conditions: 209end of tape, 210end of dump, 211tape write error, 212tape open error or 213disk read error (if there are more than a threshold of 32). 214In addition to alerting all operators implied by the 215.Cm n 216key, 217.Nm dump 218interacts with the operator on 219.Em dump's 220control terminal at times when 221.Nm dump 222can no longer proceed, 223or if something is grossly wrong. 224All questions 225.Nm dump 226poses 227.Em must 228be answered by typing 229.Dq yes 230or 231.Dq no , 232appropriately. 233.Pp 234Since making a dump involves a lot of time and effort for full dumps, 235.Nm dump 236checkpoints itself at the start of each tape volume. 237If writing that volume fails for some reason, 238.Nm dump 239will, 240with operator permission, 241restart itself from the checkpoint 242after the old tape has been rewound and removed, 243and a new tape has been mounted. 244.Pp 245.Nm Dump 246tells the operator what is going on at periodic intervals, 247including usually low estimates of the number of blocks to write, 248the number of tapes it will take, the time to completion, and 249the time to the tape change. 250The output is verbose, 251so that others know that the terminal 252controlling 253.Nm dump 254is busy, 255and will be for some time. 256.Pp 257In the event of a catastrophic disk event, the time required 258to restore all the necessary backup tapes or files to disk 259can be kept to a minimum by staggering the incremental dumps. 260An efficient method of staggering incremental dumps 261to minimize the number of tapes follows: 262.Bl -bullet -offset indent 263.It 264Always start with a level 0 backup, for example: 265.Bd -literal -offset indent 266/sbin/dump 0uf /dev/nrst0 /usr/src 267.Ed 268.Pp 269This should be done at set intervals, say once a month or once every two months, 270and on a set of fresh tapes that is saved forever. 271.It 272After a level 0, dumps of active file 273systems are taken on a daily basis, 274using a modified Tower of Hanoi algorithm, 275with this sequence of dump levels: 276.Bd -literal -offset indent 2773 2 5 4 7 6 9 8 9 9 ... 278.Ed 279.Pp 280For the daily dumps, it should be possible to use a fixed number of tapes 281for each day, used on a weekly basis. 282Each week, a level 1 dump is taken, and 283the daily Hanoi sequence repeats beginning with 3. 284For weekly dumps, another fixed set of tapes per dumped file system is 285used, also on a cyclical basis. 286.El 287.Pp 288After several months or so, the daily and weekly tapes should get 289rotated out of the dump cycle and fresh tapes brought in. 290.Sh ENVIRONMENT 291The environment variable 292.Ev RMT 293will be used to determine the pathname of the remote 294.Xr rmt 8 295program. 296.Sh FILES 297.Bl -tag -width /etc/dumpdates -compact 298.It Pa /dev/rst0 299default tape unit to dump to 300.It Pa /etc/dumpdates 301dump date records 302.It Pa /etc/fstab 303dump table: file systems and frequency 304.It Pa /etc/group 305to find group 306.Em operator 307.El 308.Sh SEE ALSO 309.Xr ft 8 , 310.Xr restore 8 , 311.Xr rmt 8 , 312.Xr dump 5 , 313.Xr fstab 5 314.Sh DIAGNOSTICS 315Many, and verbose. 316.Pp 317Dump exits with zero status on success. 318Startup errors are indicated with an exit code of 1; 319abnormal termination is indicated with an exit code of 3. 320.Sh BUGS 321.Pp 322Fewer than 32 read errors on the filesystem are ignored. 323Each reel requires a new process, so parent processes for 324reels already written just hang around until the entire tape 325is written. 326.Pp 327restore(8) is currently unable to restore dumps that were created 328with a blocksize larger than 32 on some tape drives. This is likely 329a bug in the tape driver. Workaround for safety reasons: 330dump aborts with an error message when choosing a blocksize > 32. 331.Pp 332.Nm Dump 333with the 334.Cm W 335or 336.Cm w 337options does not report filesystems that have never been recorded 338in 339.Pa /etc/dumpdates , 340even if listed in 341.Pa /etc/fstab . 342.Pp 343It would be nice if 344.Nm dump 345knew about the dump sequence, 346kept track of the tapes scribbled on, 347told the operator which tape to mount when, 348and provided more assistance 349for the operator running 350.Xr restore . 351.Sh HISTORY 352A 353.Nm dump 354command appeared in 355.At v6 . 356