FBACKUP(1M) — HP-UX
NAME
fbackup − selectively backup files
SYNOPSIS
/etc/fbackup −f device [ −f device ] ... [ −0-9 ] [ −uvyH ] [ −i path ] [ −e path ] [ −g graph ] [ −I path ] [ −c config ]
/etc/fbackup −f device [ −f device ] ... [ −R restart ] [ −uvyH ] [ −I path ] [ −c config ]
DESCRIPTION
Fbackup combines features of dump(1M) and ftio(1) to provide a flexible, high speed file system backup mechanism. Fbackup selectively transfers files to an output device. For each file transferred, the file’s contents and all the relevant information necessary to restore it to an equivalent state are copied to the output device. Generally, the output device is a raw magnetic tape drive, but it can also be the standard output or a file. By explicitly specifying trees of files to be included or excluded from an fbackup session, the user can construct an arbitrary graph of files. Fbackup selects files in this graph and attempts to transfer them to the output device. The selectivity depends on the mode in which fbackup is being used.
When doing full backups, all of the files in the graph are selected. When doing incremental backups, only the files in the graph that have been modified since a previous backup of the same graph are selected.
If fbackup is used for incremental backups, a database of past backups must be kept. Fbackup maintains this data in the text file /usr/adm/fbackupfiles/dates. The user can specify that this file should be updated when an fbackup session completes successfully. Entries for each session are recorded on separate pairs of lines. The following four items appear on the first line of each pair: the graph file name, backup level, starting time and ending time (both in time(2) format). The second line of each pair contains the same two times, but in nl_ctime(3C) format. These lines contain the local equivalent of "STARTED:", the start time, the local equivalent of "ENDED:", and the ending time. These second lines serve only to make the dates file more readable; fbackup does not use them. All fields are separated by white space.
Each volume contains an index consisting of a list of all the files in the graph being backed up. Each file entry contains the volume number and the path name of the file. At the beginning of every volume, fbackup assumes that all files which have not already been backed up will fit on that volume, which is an erroneous assumption for all but the last volume. Hence, the index on the first volume reports that all files are on volume one, and the index on the last volume is the only index which is completely accurate (see WARNINGS section). Indices that are not on the last volume are accurate for all previous volumes of the same set.
When using 9-track tape drives, fbackup checkpoints the media periodically to enhance error recovery. If a write error is detected, the user normally has two options. First, a new volume can be mounted and that volume rewritten from the beginning. Second, if the volume is not too severely damaged, the good data before the error can be saved, and the write error is treated as a normal end-of-media condition.
Fbackup provides the ability to use UCB-mode tape drives. This makes it possible to overlap the tape rewind times, if two or more tape drives are connected to the system.
Options
−c config Config is interpreted as the name of the configuration file. This file can contain values for the following parameters:
−
the number of 512 byte blocks per record,
−
the number of these records of shared memory to allocate,
−
the number of records between checkpoints,
−
the number of file reader processes,
−
the maximum number of times fbackup will retry an active file,
−
the maximum number of bytes of media to use while retrying the backup of an active file,
−
the maximum number of times a magnetic tape volume may be used,
−
the name of a file to be executed when a volume change occurs. This file must exist and be executable.
−
the name of a file to be executed when a fatal error occurs. This file must exist and be executable.
Each entry in the configuration file consists of one line of text in the following format: identifier, white space, argument. In the following sample configuration file, the number of blocks per record is set to 32, the number of records is set to 32, the checkpoint frequency is set to 32, the number of file reader processes is set to 2, the maximum number of retries is set to 5, the maximum retry space for active files is set to 5,000,000 bytes, the maximum number of times a magnetic tape volume may be used is set to 100, the file to be executed at volume change time is /usr/adm/fbackupfiles/chgvol, and the file to be executed when a fatal error occurs is /usr/adm/fbackupfiles/error.
blocksperrecord 32
records 32
checkpointfreq 32
readerprocesses 2 (maximum of 6)
maxretries 5
retrylimit 5000000
maxvoluses 100
chgvol /usr/adm/fbackupfiles/chgvol
error /usr/adm/fbackupfiles/error
Each value listed is also the default value, except chgvol and error, which default to null values.
−e path Path specifies a tree to be excluded from the backup graph. This tree must be a subtree of part of the backup graph. Otherwise, specifying it will not exclude any files from the graph. There is no limit on the number of times that the −e option can be specified.
−f device Device specifies the name of an output file. If the name of the file is "-", fbackup writes to the standard output. There is no default output file; at least one must be specified. If more than one output file is specified, fbackup uses each one successively and then repeats in a cyclical pattern.
−g graph Graph defines the graph file. The graph file is a text file containing the list of file names of trees to be included or excluded from the backup graph. These trees are interpreted in the same manner as when they are specified with the −i and −e options. Graph file entries consist of a line beginning with either i or e, followed by white space, and then a path name of a tree. Lines not beginning with i or e are ignored. There is no default graph file. For example, if a user wants to backup all of /usr except for the subtree /usr/lib, a file could be created with the following two records:
i /usr
e /usr/lib
−i path Path specifies a tree to be included in the backup graph. There is no limit on the number of times that the −i option can be specified.
−u Update /usr/adm/fbackupfiles/dates so that it contains the backup level, the time of the beginning and end of the session, and the graph file used for this fbackup session. For this update to take place, the following conditions must exist: neither the −i nor the −e option can be used, the −g option must be specified exactly once (see below), and fbackup must complete successfully.
−v Run in verbose mode. Status messages that are not normally seen are generated.
−y Automatically answer yes to any inquiries.
−H Search hidden subdirectories (context-dependent files or CDFs). Normally, only the CDF element matching the current context is backed up, without expanding the path name to show the actual element. For more information on CDFs, see cdf(4).
−I path Path specifies the name of the online index file to be generated. It consists of one line for each file backed up during the session. Each line contains the volume number on which that file resides and the file name. If the −I option is omitted, no index file is generated.
−R restart Restart an fbackup session from where it was previously interrupted. The restart file contains all the information necessary to restart the interrupted session. None of the −[ieg0-9] options can be used together with the restart option.
−0-9 This single-digit number is the backup level. Level 0 indicates a full backup. Higher levels are generally used to perform incremental backups. When doing an incremental backup of a particular graph at a particular level, /usr/adm/fbackupfiles/dates is searched to find the date of the most recent backup of the same graph that was done at a lower level. If no such entry is found, the beginning of time is assumed. All files in the graph that have been modified since this date are backed up.
RETURN VALUE
Fbackup returns 0 upon normal completion, 1 if it is interrupted but allowed to save its state for possible restart, and 2 if any error conditions prevent the session from completing.
EXAMPLES
In the following two examples, assume the graph of interest specifies all of /usr except /usr/lib (as described in the g key section above).
The first example is a simple case where a full backup is done but the database file is not updated. This can be invoked as follows:
/etc/fbackup -0i /usr -e /usr/lib -f /dev/rmt/0h
The second example is more complicated, and assumes the user wishes to maintain a database of past fbackup sessions so that incremental backups are possible.
If sufficient online storage is available, it may be desirable to keep several of the most recent index files on disk. This eliminates the need to recover the index from the backup media to determine if the files to be recovered are on that set. One method of maintaining index files online is outlined below. The system administrator must do the following once before fbackup is run for the first time (creating intermediate level directories where necessary):
−
create a suitable configuration file called config in the directory /usr/adm/fbackupfiles
−
create a graph file called usr-usrlib in the directory /usr/adm/fbackupfiles/graphs
−
create a directory called usr-usrlib in the directory /usr/adm/fbackupfiles/indices
A shell script that performs the following tasks could be run for each fbackup session:
−
build an index file path name based on both the graph file used (passed as a parameter to the script) and the start time of the session (obtained from the system): for example, /usr/adm/fbackupfiles/indices/usr-usrlib/871128.15:17 (for Nov 28, 1987 at 3:17 PM)
−
invoke fbackup with this path name as its index file name, for example,
cd /usr/adm/fbackupfiles
/etc/fbackup -0uc config -g graphs/usr-usrlib -I indices/usr-usrlib/871128.15:17 -f /dev/rmt/0h
When the session completes successfully, the index is automatically placed in the proper location.
WARNINGS
Because of present file system limitations, files whose inode data, but not their contents, are modified while a backup is in progress might not be included in the next incremental backup of the same graph. Also, fbackup does not reset the inode change times of files to their original value.
Fbackup allocates resources that are not returned to the system if it is killed in an ungraceful manner. If it is necessary to kill fbackup, send it a SIGTERM not a SIGKILL.
Indices are completely accurate only for the previous volumes in the same set. Hence, the index on the last volume may indicate that a file resides on that volume, but it may not have actually been backed up (for example, if it was removed after the index was created, but before fbackup attempted to back it up). The only index guaranteed to be correct in all cases is the online index, which is produced after the last volume has been written.
For security reasons, configuration files and the chgvol and error executable files should only be writable by their owners.
If sparse files are backed up without using data compression, a very large amount of media might be consumed.
The user of fbackup need not be the super-user. However, if the user does not have access to a given file, the file is not backed up.
Fbackup consists of multiple executable objects, and it expects all of these to reside in /etc.
Graph file names are compared character by character when checking the /usr/adm/fbackupfiles/dates file to ascertain when a previous session was run for that graph. Caution must be exercised to ensure that, for example, "graph" and "./graph" are not used to specify the same graph file, because fbackup treats them as two different graph files.
DEPENDENCIES
Series 800
The −H option is not currently implemented.
AUTHOR
Fbackup was developed by HP.
FILES
/usr/adm/fbackupfiles/dates Database of past backups.
SEE ALSO
cpio(1M), dump(1M), frecover(1M), ftio(1M), restore(1M), tcio(1M), cdf(4).
Hewlett-Packard Company — May 11, 2021