The SVR3 and SVR4 backup Commands

Tuesday Level 2 backup daily incremental to the previous level 1 Wednesday Level 2 backup daily incremental to the previous level 1 Thursday Level 2 backup daily incremental to the previous level 1 Friday Level 2 backup daily incremental to the previous level 1 The main criterion for planning a backup schedule is how the system is used. The most used portions of the filesystem may need to be backed up more often than the other parts; for example, the root filesystem with standard UNIX programs and files that rarely change does not require frequent backup. Some parts of the system, like the tmp directory, need never be backed up. Sometimes, additional filesystems can be created; they might need to be backed up often, or very rarely, or never at all. The full backup should be performed whenever significant changes are made to the system, regardless of the current backup schedule. This might be one of the few times that the root filesystem gets backed up. The worst part of doing backups is sitting around waiting for them to finish; this will often feel like wasted time. Unattended backups solve this problem for some sites. If the backup will fit on a single tape, and new technologies enable it, then the tape can be put in the drive and the backup performed during the night. In the morning the operator simply has to pick up and label the tape. However, unattended backups can be a security risk; nontrusted users with physical access to the tape drive may cause a problem.

12.4 Backup and Dump Commands

Despite the fact that system backups have always been one of the main issues in the administration of any software system, there is no uniform approach for handling this task in UNIX. Rather, the opposite is true: there are many different approaches. More specifically, there are many different utilities and commands mostly flavor− and releasebased that address data backup and restoration. The following text is an attempt to at least briefly specify and present some of them.

12.4.1 The SVR3 and SVR4 backup Commands

First, a quick look into the history: backups under System V went through several phases before arriving at todays process. SVR3 provided the backup command, which was really an interface to the cpio command. It could perform a full or an incremental backup of the filesystem, or backup a list of files, or users home directories, to either a tape or a floppy disk. Today, the command itself is obsolete. The syntax of this backup command was: backup [options] The options specified the action to be performed, as seen in the following table. Options Meaning −c Complete full backup −p Partial incremental backup −f file_list Backup the specified files place the list in quotes −u user Back up all files under users home directory 282 The specified device is a tape device default is floppy −h List the dates of the last incremental and full backup A few examples: backup −c −t −d devrmtc0s0 The full backup to the first tape drive; backup −p The incremental backup to the default floppy drive devrdskf05h; backup −u username −d devrdskf03h Copy all files under user usernames home directory to a high density 3–12 floppy drive. SVR4 introduced an improved backup tool — a highly sophisticated and powerful backup utility that enabled administrators to implement and manage an arbitrarily elaborate backup plan. It enabled automation of most backup tasks except physical mounting of tapes. On the other hand, it was more complex than absolutely necessary for some systems. Unfortunately, we cannot talk about a uniquely accepted and implemented backup utility — each System V flavor had some peculiarities. For example, on SGI IRIX even the name of the utility was abbreviated and modified into usrsbinbru, the Backup and Restore Utility, to point out its inherent restore capabilities. A typical example of a SVR4 backup utility is the one that existed on HP−UX 9.0x. Although HP−UX 9.0x is a more−or−less obsolete UNIX flavor today, the backup utility can be used to provide an understanding of different backuprestore issues. First, it is a shell script that could be easily read and understood; second, it is based primarily on the find and cpio UNIX commands, with which administrators should be familiar. Briefly, the backup scheduling was controlled by the configuration file etcarchivedate on some UNIX systems the file was etcbkupbkreg.tab. The configuration file defined each participating filesystem in the backup, a backup schedule, destinations, and other information. The format of the command to start a backup is: etcbackup [−A] [−archive] [−fsck] The −A option suppressed warning messages regarding optional access control list entries. Normally, a warning message was printed for each file having optional access control list entries. The −archive option caused backup to save all files, regardless of their modification date, and then update etcarchivedate using the touch command. backup sent a prompt when a new tape needed to be loaded and continued, if there was no more room on the current tape. However, the prompting did not occur if backup had been run from cron. The −fsck option caused backup to start a filesystem consistency check without correction once the backup was complete. For correct results, it was important that the system had been effectively single−user while fsck was running with the corresponding filesystem dismounted, especially if −fsck was allowed to automatically fix whatever inconsistencies it found. backup itself did not ensure that the system was in single−user mode. The script etcbackup could be customized, and several local values were available for customization: backupdirs Specified which directories to back up recursively usually , which meant all directories 283 were logged archive The name of the file whose date was the date of the last archive remind The name of the file that was checked by etcprofile to remind the next logged−in person to change the backup tape outdev Specified the output device for the backed−up files fscklog The name of the file where start and finish times and fsck output was logged In all cases, the output from backup utility was a normal cpio archive file. For data recovery, it is important to note that backup creates archive tapes with all files and directories specified relative to the root directory. Consequently, data recovery should be invoked from the root directory with recovered files directory path names specified relative to the root directory .

12.4.2 The fbackup Command