FTIO(1)
Series 500 Only
NAME
ftio − faster tape I/O
SYNOPSIS
ftio −o | O [ cvaxEpLM ] [ -N datefile ] [ -Z nobufs ] [ -B blksize ] [ -S script ] [ -K comment ] [ -L filelist ] tapedev [ pathnames ] [ -F ignorenames ]
ftio −i | I [ cdmtuvfxAPEpMR ] [ -Z nobufs ] [ -B blksize ] [ -S script ] 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 two processes (one reading/writing the file system, one writing/reading the tape device) with large amounts of shared memory between the processes, as well as a large block size for reading and writing to the tape.
The tool is compatible with cpio in that output from cpio(1) is always readable by ftio, and output from ftio is readable with exceptions by cpio(1). See the CPIO COMPATIBILITY section for a more detailed explanation.
Ftio with the -o (copy out) option copies files onto tapedev together with path name and status information. If pathnames was specified, ftio recursively descends pathnames looking for files, and copies those files onto tapedev, if not, 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 will generate, for each tape in the tape set, a tape header containing the current tape number, machine nodename 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.
When invoked using ftio -O, the default behavior is the same as for ftio -ocva. However, if the file .ftiorc exists in the user’s home directory, ftio will open this file, and scan 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 the EXAMPLES section.
Ftio with the -i (copy in) option extracts files from tapedev, which is assumed to be the product of a previous ftio -o operation. Only files with names that match patterns are selected. Patterns are given in the name-generating notation of sh(1). In patterns, meta-characters ?, ∗, and [...] match the slash / character. Multiple patterns may be specified and if no patterns are specified, the default for patterns is ∗ (i.e., 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 will be those of the previous -o operation.
When invoked using ftio -I, the default behavior is the same as for ftio -icdmv. However, if the file .ftiorc exists in the user’s home directory, ftio will open this file, and scan 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 the EXAMPLES section.
Ftio with the -g option reads the file list on tapedev. If patterns is specified, only file names which match will be 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, and therefore only the last volume is valid in this respect.
Options
The meanings of the available options are:
a After files have been copied out to tape, reset the access time so that it appears the file had not been accessed by ftio.
d When restoring files, directories are to be created as needed.
c Write header information in ASCII character form for portability.
t Print only a table of contents of the input. No files are created, read, or copied.
u Copy unconditionally (normally, an older file will not replace a newer file with the same name).
x Save or restore device special files. Ftio will use mknod(2) to recreate these files during a restore operation. Thus, this option is restricted to the super-user. This is intended for intrasystem (backup) use. Restoring device files onto a different system can be very dangerous.
v Verbose: causes a list of file names as well as tape headers to be printed. When used with the t option, the table of contents looks like the output of ls -l command (see ls(1)).
m Retain previous file modification time and ownership of file. Restoration of modification time is ineffective on directories that are being restored.
f Copy in all files except those that match patterns.
A Print all file names found on the archive, noting which files have been restored. This is useful when the user is restoring selected files, but wants to know which (if any) files are on the tape.
P On restoration, use prealloc(2) to pre-allocate disk space for the file, this vastly improves the localization of file fragments.
E When archiving, all files with absolute path names are archived with a path name relative to the root directory, i.e., all files whose name starts with ’/’ have the first ’/’ removed. On restoration, any files in the archive that have an absolute path name, have the leading ’/’ removed from the path name and are restored relative to the current directory.
p The number of blocks transferred, the total time taken (excluding tape rewind and change reel time), and the effective transfer rate, calculated from these figures, is printed at the end of the backup. If the option is given twice, this will be done at the end of each tape.
Z The next argument (nobufs) specifies 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. 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, but the use of 32 or 64 may improve performance if your system is relatively unloaded. We recommend performing a backup with the system in single user mode.
B The next argument (blksize) specifies the size (in bytes) of blocks written to tape. This number may end with "k", specifying multiplication by 1024. Larger blocks will generally improve performance, as well as improving tape usage. The maximum block size allowed is limited by the tape drive being used. A default of 16384 bytes is set, as this is the maximum block size on most Hewlett-Packard tape drives.
S The next argument (script) specifies a command which is 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 script specified by 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.
K The next argument (comment) specifies a comment to be placed in the ftio tape header.
F 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.
N Only files that are newer than the file specified in the following argument (datefile) are copied to tape.
L If the L option is specified and pathnames have been given, ftio will 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. By definition, the last tape in the backup will contain 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. The file list is also left in the current directory as the file ftio.list, if the L has been used with an argument (filelist), then the argument 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 a bad medium.
M Do not generate or expect tape headers, and change the default block size to 5120 bytes. This allows for full compatibility with cpio(1). See discussion in CPIO COMPATIBILITY section.
R Ftio will automatically resync when it gets out of phase. This is useful when restoring from a multi tape backup on tapes other than the first. The default behavior is that ftio will ask the user if resyncing is required.
When the end of the tape is reached, ftio will invoke script if the -S option has been exercised, rewind the current tape, then ask the user to mount the next tape.
If you want to pass one or more metacharacters to ftio without the shell expanding them, be sure to protect them by either preceding each of them with a backslash (e.g., /usr\*), or enclosing in protection quotes (e.g., ’/usr*’).
Device files written with the −o option (e.g. /dev/tty03) will not transport to other implementations of HP-UX.
EXAMPLES
The first example below copies the entire contents of the file system (including special files) onto the tape drive /dev/rmt/0h:
ftio -ox /dev/rmt/0h /
The following example will restore all the files on /dev/rmt/0h, relative to the current directory:
ftio -idxE /dev/rmt/0h
The following example demonstrates how to list the contents of a backup set created using ftio -o.
ftio -itv /dev/rmt/0h
Note that use of the -v option will give a more detailed listing, and will display the contents of tape headers.
The next example demonstrates the use of the .ftiorc file. The user has a .ftiorc file in their home directory with the following contents:
# 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
Ftio is invoked with the following command line to backup the users home directory and the system binary directory:
ftio -O /dev/rmt/0h /user/my_home /bin
Because the -O option has been specified, the .ftiorc will be checked for additional options. In this case, character headers will be generated, access times will be reset, a listing of the files copied will be printed to standard output, all file names will be copied to /dev/rmt/0h with path names relative to ’/’, performance data will be 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" will be invoked by ftio after each media is completed.
SIGNAL HANDLING (WARNING)
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 will do this only when it terminates normally, or when it terminates after receiving one the following signals: SIGHUP, SIGINT, SIGTERM. Any other signal will be 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(1) -9), system resources used for shared memory and semaphores will not be 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).
CPIO COMPATIBILITY
Ftio uses the same archive format as cpio(1). However, the default behavior of ftio is to create tape headers and to use 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 the -M option. Ftio -oM will create a single or multi tape archive which has no tape headers, and by default the same block size as cpio -[o|i]B. An archive created by a cpio -oB command may be restored using ftio -iM. If the -M option of ftio is combined with a -B 512 block size specification, full compatibility with cpio -[o|i] (no -B) is achieved.
AUTHOR
Ftio was developed by HP.
SEE ALSO
cpio(1), find(1), cpio(4), ipcs(1), ipcrm(1), mt(7).
Hewlett-Packard Company — April 12, 1993