ftio(1)
NAME
ftio − faster tape I/O
SYNOPSIS
ftio −o | −O [achpvxAEHLM] [−B blksize] [−D type] [−K comment] [−L filelist] [−N datefile]
[−S script] [−T tty] [−Z nobufs] tapedev [pathnames] [−F ignorenames]
ftio −i | −I [cdfmptuvxAEMPR] [−B blksize] [−S script] [−T tty] [−Z nobufs] tapedev [patterns]
ftio −g [v] tapedev [patterns]
DESCRIPTION
ftio is a tool designed specifically for copying files to 9-track magnetic tape drives. It should perform faster than either cpio(1) or tar(1) in comparable situations. ftio uses multiple processes (to read/write the file system and to write/read the tape device) with large amounts of memory sharing between processes, as well as a large block size for reading and writing to the tape.
ftio is compatible with cpio in that output from cpio(1) is always readable by ftio, and output from ftio is readable by cpio(1), except as explained in the cpio Compatibility section below.
ftio must be invoked with exactly one of the options −o, −O, −i, −I, or −g. The option can be followed by modifiers which must appear immediately after the option with no spaces between the option and the modifier, as in ftio −idxE (see Modifiers section below).
tapedev specifies the name of an output file. A device on a remote machine can be specified in the form
machine:device
ftio creates a server, /etc/rmt, on the remote machine to access the tape device.
Options
ftio recognizes the following options:
-o Copy out files onto tapedev together with path name and status information. If pathnames are specified, ftio recursively descends pathnames looking for files, and copies those files onto tapedev. If pathnames are not specified, ftio reads the standard input to obtain a list of path names to copy. In addition to copying the files onto the tape set, ftio generates, for each tape in the tape set, a tape header containing the current tape number, machine node name and type, operating system name, release and version numbers (all from uname(2)), username of the backup initiator, time and date of the backup, number of consecutive times the current media has been used, a comment field, and other items used internally by ftio. The tape header is separated from the main body of the archive by an end of file mark. The tape header can be read by invoking cat(1) with the device file name as the first argument. Note that device files written with the −o option (such as /dev/tty03) are not transportable to other HP-UX implementations.
-O Copy out files in the same way as ftio −ocva when no modifiers are used with the −O. However, if the file .ftiorc exists in the user’s home directory, ftio opens this file and scans for lines preceded by O=. Options defined on matching lines are passed to ftio as if they had been passed in the original command. See EXAMPLES section.
−i Extract, or copy in, files from tapedev, which is assumed to be the product of a previous ftio −o operation. Only files with names that match patterns, according to the rules of Pattern Matching Notation (see regexp(5)), are selected. In addition, a leading ! within a pattern indicates that only those names should be selected that do not match the remainder of the pattern. Multiple patterns can be specified. If no patterns are specified, the default for patterns is ∗ (that is, select all files). The extracted files are conditionally created and copied into the current directory tree, based upon the options described below. The permissions of the files are those of the previous −o operation.
−I Extract, or copy in, files in the same way as for ftio −icdmv when no modifiers are used with the −I. However, if the file .ftiorc exists in the user’s home directory, ftio opens this file, and scans for lines preceded by I=. Options defined on matching lines are passed to ftio as if they had been passed in the original command. See EXAMPLES section.
−g Read the file list on tapedev. If patterns is specified, only file names that match are printed. Note that file names are always preceded by the volume that ftio expected the file to be on when the file list was created; thus only the last volume is valid in this respect.
−B blksize Specify the size (in bytes) of blocks written to tape. This number can end with k, which specifies multiplication by 1024. The use of larger blocks generally improves performance and tape usage. The maximum allowable block size is limited by the tape drive used. A default of 16384 bytes is set because this is the maximum block size on most Hewlett-Packard tape drives.
−D type Recursively descend a directory only if the file system to which it belongs is of type type, where type is either hfs or nfs.
−F ignorenames Arguments following -F specify patterns that should not be copied to the tape. The same rules apply for ignorenames as do for patterns, see the previous description for ftio -i.
−K comment Specify a comment to be placed in the ftio tape header.
−L filelist If pathnames is specified, perform the file search and generate a list of files to back up prior to actually commencing the backup. This list is then appended to the tape header of each tape in the backup as a list of files that ftio attempted to fit onto this tape. The last tape in the backup contains a catalog of where the files are in the archive set. If pathnames is not specified, the file list is taken from standard input before the backup begins. filelist specifies the output file. In addition to generating file lists, the −L option implements tape checkpointing, allowing the backup to restart from a write failure on bad media.
−M Do not generate or expect tape headers, and change the default block size to 5120 bytes. This provides full compatibility with cpio(1) (see the cpio Compatibility section below).
−N datefile Only files that are newer than the file specified in datefile are copied to tape.
−R Automatically resynchronize when ftio goes out of phase. This is useful when restoring from a multi-tape backup on tapes other than the first. Default behavior is that ftio asks the user if resyncing is required.
−S script Specify a command to be invoked every time a tape is completed in a multi-tape backup. The command is invoked by sh(1) with the following arguments: script tape_no user_name. script is the string argument script specified with the −S option. tape_no is the number of the tape required, and user_name is the user who invoked ftio. Typically, the string script specifies a shell script which is used to notify the user that a tape change is required.
−T tty Specify alternate to /dev/tty. Normally /dev/tty is opened by ftio when terminal interaction is required.
−Z nobufs Specify the number of blksize chunks of memory to use as buffer space between the two processes, where blksize is the size of blocks written to the tape. The use of more chunks is usually better, but a point is reached where no improvement is gained, and in fact performance may deteriorate as buffer space is swapped out of main memory. A default value of 16 is set for nobufs, but the use of 32 or 64 may improve performance if your system is not heavily loaded. Best results are obtained when backups are performed with the system in single-user mode (see shutdown(1M)).
Modifiers
The following modifiers can be used with certain options as indicated in the SYNOPSIS:
a After files are copied out to tape, reset the access time to appear as though the file was not accessed by ftio.
c Write header information in ASCII character form for portability.
d When restoring files, create directories as needed.
f Copy in all files except those that match patterns.
h Archive the files to which symbolic links point as if they were normal files or directories. Normally, ftio archives the link itself.
m Retain previous file modification time and ownership of file. Restoring modification time does not apply to directories that are being restored.
p At the end of the backup, print the number of blocks transferred, the total time taken (excluding tape rewind and reel-change time), and the effective transfer rate calculated from these figures. These values are printed at the end of each tape if p is given twice.
t Print only a table of contents of the input. No files are created, read, or copied.
u Copy unconditionally (normally, an older file does not replace a newer file with the same name).
v Be verbose. Print a list of file names as well as tape headers. When used with the t modifier, the table of contents looks the same as the output of the ls −l command (see ls(1)).
x Save or restore device special files. ftio uses mknod(2) to recreate these files during a restore operation. Thus, this modifier is restricted to users with appropriate privileges. This is intended for intrasystem (backup) use. Restoring device files onto a different system can be very dangerous.
A If copying from tape (−i or −I option), print all file names found on the archive, noting which files have been restored. This is useful when the user restores selected files, but wants to know which (if any) files are on the tape.
If copying to tape (−o or −O option), suppress warning messages regarding optional access control list entries. ftio(1) does not back up optional access control list entries in a file’s access control list (see acl(5)). Normally, a warning message is printed for each file that has optional access control list entries.
E When archiving, store all files having absolute path names (pathname starts with /) with a path name that is relative to the root directory (in other words, remove the leading / from all files whose name starts with /). On restoration, any files in the archive that had an absolute path name before archiving (the leading / was removed from the path name) are restored relative to the current directory.
L Same as the −L option, except that the file list is left in the current directory as the file ftio.list, instead of the file named in filelist.
H Search hidden subdirectories (context-dependent files or CDFs). Normally, only the CDF element matching the current context is archived, without expanding the path name to show the actual element. For more information on CDFs see cdf(4).
P On restoration, use prealloc(2) to pre-allocate disk space for the file. This vastly improves the localization of file fragments.
When end-of-tape is reached, ftio invokes script if the −S option has been exercised, rewinds the current tape, then asks the user to mount the next tape.
To pass one or more metacharacters to ftio without having the shell expand them, protect them either by preceding each of them with a backslash (as in /usr\*), or enclosing them in protective quotes (as in ’/usr*’).
cpio Compatibility
ftio uses the same archive format as cpio(1). However, by default ftio creates tape headers and uses a tape block size of 16k bytes. cpio(1) by default uses 512 byte blocks. When used with the −B option, cpio(1) uses 5120 byte blocks. To achieve full compatibility with cpio(1) in either input or output mode, the user should specify the M modifier. ftio −oM creates a single or multi-tape archive that has no tape headers, and, by default, the same block size as cpio −[o |i]B. An archive created by a cpio −oB command can be restored using ftio −iM. If the M modifier of ftio is combined with a −B 512 block-size specification, full compatibility with cpio −[o|i] (no −B) is achieved.
EXTERNAL INFLUENCES
Environment Variables
LC_COLLATE determines the collating sequence used in evaluating pattern matching notation for file name generation.
LC_CTYPE determines the characters matched by character class expressions in pattern matching notation.
LC_TIME determines the format and contents of date and time strings.
LANG determines the language in which messages are displayed.
If LC_COLLATE, LC_CTYPE, or LC_TIME is not specified in the environment or is set to the empty string, the value of LANG is used as a default for each unspecified or empty variable. If LANG is not specified or is set to the empty string, a default of "C" (see lang(5))isusedinsteadof LANG. If any internationalization variable contains an invalid setting, ftio behaves as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
Single-byte character code sets are supported.
EXAMPLES
Copy the entire contents of the file system (including special files) onto tape drive /dev/rmt/0h:
ftio -ox /dev/rmt/0h /
Restore all the files on /dev/rmt/0h, relative to the current directory:
ftio -idxE /dev/rmt/0h
List the contents of a backup set created using ftio −o. Note that use of the v modifier gives a more detailed listing, and displays the contents of tape headers.
ftio -itv /dev/rmt/0h
Show how to use the .ftiorc file:
Assume a .ftiorc file exists in the user’s home directory and contains the following:
# Example .ftiorc file.
I= cdmuvEpp -B 16k -S /usr/local/bin/ftio.change
O= cavEpp -Z 8 -B 16k -S /usr/local/bin/ftio.change
Invoked ftio with the following command line to back up the user’s home directory and the system binary directory:
ftio -O /dev/rmt/0h /user/my_home /bin
Specifying the −O option causes ftio to check the .ftiorc file for additional options. In this case, character headers are generated, access times are reset, a listing of the files copied are printed to standard output, all file names are copied to /dev/rmt/0h with path names relative to /, performance data is printed when the backup is complete (and at every tape change), and, if the backup goes beyond one media the script, /usr/local/bin/ftio.change is invoked by ftio after each media is completed.
WARNINGS
ftio uses System V shared memory and semaphores for its operation. The resources committed to these functions are not automatically freed by the system when the process terminates. ftio does this only when it terminates normally, or when it terminates after receiving one the following signals: SIGHUP, SIGINT, SIGTERM. Any other signal is handled in the default manner described by signal(2). Note that the behavior for SIGKILL is to terminate the process without delay. Thus, if ftio receives a SIGKILL signal (as might be produced by the indiscriminate use of kill −9, see kill(1)), system resources used for shared memory and semaphores are not returned to the system. If it becomes necessary to terminate an invocation of ftio, use kill −15. Current system usage of shared memory and semaphores can be checked using ipcs(1). Committed resources can be removed using ipcrm(1).
AUTHOR
ftio was developed by HP.
SEE ALSO
cpio(1), find(1), ipcs(1), ipcrm(1), kill(1), ls(1), rmt(1M), mknod(2), prealloc(2), signal(2), uname(2), cdf(4), acl(5), environ(5), lang(5), regexp(5), mt(7).
Hewlett-Packard Company — HP-UX Release 8.05: June 1991