The dumpufsdump Command Backup and Dump Commands

s Follows symbolic links by default it does not v Verbose otherwise fbackup works silently u Updates the backup database 0–9 Specifies the backup level 0 is a full backup I Also writes the index the list of backed−up files in the file specified as an argument by default it is written only into the tapevolume V Also writes the volume header in the file specified as an argument by default it is written only into the tapevolume R Continues restarts an interrupted backup Note: There are more options that make fbackup more powerful and flexible. The following script illustrates how the command can be used. The script provides a full backup of data defined in the graph file, a list of backed−up files is created in the index file, and the corresponding logging is provided. cat usrlocalfbackupbinfbackup.full binsh MT_DEVICE=devrmt0m GRAPH_FILE=usrlocalfbackupgraphgraph.full INDEX_FILE=usrlocalfbackupindexindex.full LOG_FILE=usrlocalfbackuplogfbackup.log. date +a mt −t MT_DEVICE rewind echo date: Fbackup started LOG_FILE etcfbackup −f MT_DEVICEdevrmt0m −0 −u −v −g GRAPH_FILE −I INDEX_FILE LOG_FILE echo date: Fbackup finished. LOG_FILE

12.4.3 The dumpufsdump Command

Originally a BSD−type command, the dump command is the most common filesystem−related UNIX backup command. Some flavor−colored variations of the command exist among different UNIX platforms, including modified command names on some System V versions: ufsdump or even ufsbackup. Despite the discrepancies in the names, the two commands dump and ufsdump behave the same or almost the same. We will call the command dumpufsdump, just to emphasize their common functions and similar behavior. dumpufsdump keeps track of when it last saved each filesystem and the level at which the filesystem was saved. This information is stored in the file etcdumpdates. A typical entry in this file is: devdisk2e 2 Sun May 8 13:14:56 1998 This entry indicates the filesystem devdisk2e was last backed up on Sunday, May 8, 1998, and it was level 2 backup. If the filesystem cannot be found in this file, it can be assumed that it was not backed up. Here is a real example from a still−active ULTRIX system: 285 devrrz0a 0 Tue Sep 20 00: 38:28 1998 devrrz0h 0 Tue Sep 20 00: 39:53 1998 devrrz1h 0 Tue Sep 20 01: 12:35 1998 devrrz2h 0 Tue Sep 20 01: 37:19 1998 devrra35c 0 Tue Sep 20 02: 25:42 1998 devrra34c 0 Mon Apr 19 16: 02:51 1997 devrrz0a 9 Fri Sep 23 05: 48:50 1998 devrrz0h 9 Fri Sep 23 05: 52:44 1998 devrrz1h 9 Fri Sep 23 06: 08:55 1998 devrrz2h 9 Fri Sep 23 06: 12:54 1998 devrra35c 9 Fri Sep 23 06: 19:45 1998 The file etcdumpdates must exist before the dumpufsdump command is performed, and it must be owned by the user root the best way to create the file the first time using touch etcdumpdates. The general form of the dump command is: dump options arguments special_file or, alternatively: ufsdump options arguments special_file where options A list of options to be used for this backup arguments A list of arguments corresponding to these options; not all options require arguments special_file A block special file corresponding to the mounted filesystem to be backed up on some systems a character special file is requested The dumpufsdump command should be used carefully. Options and corresponding arguments are specified within two separate lists, but the list of arguments must strictly correspond, in order and in number, to the list of options requiring arguments. Failing to observe this rule could have disastrous effects and consequences, including destroying the filesystem. It is highly recommended that you create shell scripts that will automatically invoke dumpufsdump commands with proper options and arguments to avoid human errors. Special attention should be paid to the following two issues in using dumpufsdump: The filesystem to be backed up should always be the last item on the command line. If a tape drive specification accidentally follows the disk drive specification, the filesystem could be corrupted because dump will backup the tape onto the disk. 1. If the tape drive specification is missing, the backup will be performed assuming the default values. On some systems, it is necessary to select the density on the tape drives front panel in addition to specifying the correct special device file dump can unexpectedly run out of tape. 2. At the end the universal advice: check the manual pages for each individual command flavor, because there may be differences in their use. The important dumpufsdump options are: Option Meaning 286 b This option requires an argument, which specifies the blocking factor for tape writing default is 20 blocks per write, for cartridge 126 blocks per write. A block is 512 bytes. c Indicates a cartridge instead of the standard half−inch reel; sets another set of default arguments. d This option requires an argument, which specifies the tape density in bpi bits per inch: 1600 bpi for 12 tape, 1000 bpi for QIC, 54,000 bpi for 8mm tape. If the option is omitted, the default is 1600 BPI. f This option requires an argument, which specifies another dump medium instead of the default tape drive it can be a file or another device. s This option requires an argument, which specifies the size of the backup tape in feet The argument does not correspond literally to the tape size, so the values for different tapes must be read. If the option is omitted, the default is 2300−foot tape. t This option requires an argument, which specifies the number of tracks for a cartridge tape 60MB QIC has 9 tracks; 150MB QIC has 18 tracks. u If dump finishes successfully, this option updates its history file etcdumpdates. W This option asks dumpufsdump to report which filesystems need to be backed up, without taking any action. It reads etcdumpdates and etcfstab to determine what filesystems need backups. If this option is present, dumpufsdump will ignore all other options, except for the dump level. Here are some argument values that produce satisfactory results on a number of typical tape drives. Note that individual options can be in any order; however, the position of each argument depends on the relative position of each option. Tape Command partial 60MB QIC dump cdst 1000 425 9… 150 QIC dump cdst 1000 700 18… 12 tape dump dsb 1600 2300 126… 2GB 4mm tape dump dsb 54000 6000 126… The dumpufsdump command is used in the following way: dump 2usfd 2300 devrmt1 6250 devdisk1d Performs a level 2 backup on the filesystem accessed via dev disk1d, using a 9−track 2300 foot long s tape drive devrmt1 at 6250 BPI density d, then updates the file etcdumpdates u. dump 3usdf 2300 6250 devrmt20 devdisk1d Performs a level 3 backup on the filesystem accessed via dev disk1d using the 9−track 2300 foot long s tape drive devrmt20 at 287 dump 1usdf 1422 devrfd0a devrsd0g Performs a level 1 backup on the filesystem accessed via dev rsd0g to a floppy drivedevrfd0a on a Sun system, then updates the file etcdumpdates. dump 4Wd 6250 devdisk1d Does not back up any filesystem. It will print a complete list of all filesystems indicating the last time each filesystem was backed up, the level at which it was backed up, and whether or not it needs to be backed up at level 4 when the W option is specified, all other options but the level number are ignored.

12.4.4 A Few Examples