BACKUP(8,C) AIX Commands Reference BACKUP(8,C)
-------------------------------------------------------------------------------
backup
PURPOSE
Backs up files.
SYNTAX
+--- -9 ---+ +------+ +----- / ------+
+----------------+ +-| |-| |-| |-+
/etc/backup ---| +------------+ |-| +- -level -+ +- -u -+ +- filesystem -+ |-|
+-| -c |-+ | +------+ |
^| -f device || | +-| |--- -i --------------------+ |
|| -l num || +-| +- -b -+ +----- / ------+ |-+
|| -v || +--- -m -----| |--------+
|| -C num || +- filesystem -+
|| -d density ||
|| -s length ||
|| -r ||
|| -q ||
|+------------+|
+--------------+
DESCRIPTION
The backup command copies files in backup format to a backup medium, such as a
magnetic tape or diskette.
There are three ways to back up data:
-i Backs up specified files.
-level Backs up an entire file system.
-m Backs up an entire minidisk.
To back up specific files, use the -i flag. The backup command reads standard
input for the files to be backed up. You can specify files by using the find
command to generate a list of path names and pipe the list into the backup
command.
To back up file system (inode), specify -level and filesystem to indicate the
files you want to back up. You can use the level variable to back up all files
on the system (a full backup) or only the files that have been modified since a
specific full backup (an incremental backup). The possible levels are 0-9. If
you do not supply a value for level, the default value is 9. If you specify 0,
all files on the file system are backed up. If you specify n, all files
modified since the last (n-1) backup are backed up. The levels, in conjunction
with the -u flag, provide an easy way to maintain a hierarchy of incremental
Processed November 8, 1990 BACKUP(8,C) 1
BACKUP(8,C) AIX Commands Reference BACKUP(8,C)
backups for each file system. For a discussion of backup strategy and the use
of incremental backups, see Managing the AIX Operating System.
If you specify a filesystem, the name can be either the physical device name
(the block or raw name) or the name of the directory on which the file system
is normally mounted. When you specify a directory, the backup command reads
the /etc/filesystems file, for the physical device name. In this case, the
command also acquires values for other backup parameters from the
/etc/filesystems file. If you do not specify a file system, the default is the
root file system.
To back up a minidisk, use the -m flag. This option copies an exact image of
the entire minidisk. You can specify the file system name of the minidisk.
The default is the root file system. Because a backup by minidisk backs up an
entire minidisk as an exact image, backing up a large minidisk with a small or
sparsely used file system may take longer and require more backup medium than
backing up a file system or specific files.
When you do not specify a backup device the backup command writes files to a
default backup device. When you back up specific files, the system writes to
the /dev/rfd0, unless you specify a device with the -f flag. When backing up a
file system or minidisk, the backup command searches the /etc/filesystems file
for a stanza matching the file system name you specified. If found, backup
searches this stanza for a backup entry and writes to the device specified.
Otherwise, the system writes to the /dev/rfd0, or the device specified with the
-f flag.
The backup command recognizes a special syntax for the names of output files.
If the argument is a range of file names, such as /dev/rfd0 through /dev/rfd3,
the backup command automatically goes from one drive in the range to the next.
After exhausting all of the specified drives, the command halts and requests
that new volumes be mounted.
Notes:
1. If the file system you are backing up is mounted and is not the root file
system, the backup command unmounts the file system before it performs an
inode backup and then remounts the file system before quitting. If the
file systems you are backing up include the root file system, the backup
command ensures that the other file systems are not in use. If one is, the
command warns you of this use and quits.
2. When you are using the backup command on an internal tape backup unit, the
-C option is ignored and the -s option cannot be used. Use the -f option
to specify a PS/2 internal tape backup unit. For example:
find . -print | backup -ivf/dev/rst0
Use a 200 series minor device (for example, /dev/rst204) to restore a tape
backed up with a 0 series (best for backup) minor device (for example,
dev/rst0). Using the 0 series minor device number can, under some
Processed November 8, 1990 BACKUP(8,C) 2
BACKUP(8,C) AIX Commands Reference BACKUP(8,C)
circumstances, result in a "READ ERROR on sector ####, assuming zeros"
message, but should not affect the data being restored.
Warning: Be sure that the flags you specify match the backup medium. If the
backup medium is not a disk or diskette, do not specify the -l flag.
Similarly, if the backup medium is not a tape, do not specify the -d or -s
flags. If you do specify flags that do not go with the medium, the backup
command displays an appropriate error message and continues the backup.
FLAGS
-b Enables users to back up files in unattended mode (when user
input is not permitted). If any user input (such as, "Please
insert volume 2") is required, the command ends in an error.
This enables users to set up a shell file that backs up files
at night or at other times when the user is unavailable. The
-b option can only be used with the -i backup mode.
-c Creates a backup format compatible with AIX/RT. This flag must
be used when the backup command is used to transport data to
AIX/RT and AIX RS/6000. This flag is ignored if the -m flag is
also specified.
-Cnum Specifies the number of blocks in 1K bytes to write in a single
output operation. If you do not specify num, the backup
command uses a default value appropriate for the physical
device selected. Larger values of num result in longer
physical transfers to tape devices. The value of the -C flag
is always ignored when the backup command writes to diskette.
In this case, it always writes in clusters that occupy a
complete track.
-ddensity Specifies the density of a tape medium in bytes per inch. The
default density is 700 bytes per inch. The density you specify
depends on your hardware; consult your tape drive operation
manual.
-fdevice Specifies the output device. Specify device as a file name
(such as /dev/rmt0) to send output to the named device or
specify - (minus) to send output to the standard output device.
The - feature enables you to improve performance when backing
up to streaming tape by piping the output of the backup command
to the dd command.
-i Reads standard input for the names of files to back up.
-lnum Uses num as the limit of the total number of blocks to use on a
diskette. The default value is the entire diskette (1440
blocks).
-m Backs up the entire minidisk as an exact image.
Processed November 8, 1990 BACKUP(8,C) 3
BACKUP(8,C) AIX Commands Reference BACKUP(8,C)
-q Indicates that removable medium is ready to use. When you
specify this flag, the backup command proceeds without
prompting you to prepare the backup medium or waiting for you
to press the Enter key to continue. Same as the -r flag.
-r Indicates that removable medium is ready to use. When you
specify this flag, backup proceeds without prompting you to
prepare the backup medium or waiting for you to press the Enter
key to continue. Same as -q flag.
-slength Specifies the length in feet of usable space on a tape medium.
This length is a combination of the physical length and the
number of tracks on the tape.
-u Updates the time, date, and level of the backup in the
/etc/budate file. This file provides the information needed
for incremental backups.
-v Reports on each phase of the backup as it is completed and
gives regular progress reports during the longest phase.
-level Specifies the backup level (0-9). The default level is 9.
You should use the -u flag when you do an incremental backup to
ensure that information regarding the last date, time, and
level of each incremental backup is written to the file
/etc/budate.
EXAMPLES
1. To back up selected files:
find $HOME -print | /etc/backup -i -v
The "-i" flag causes the system to read from standard input the names of
files to be backed up. The find command generates a list of files in the
user's "$HOME" directory. This list is piped to the backup command as
standard input. The -v flag causes a progress report to be displayed as
each file is copied. The files are backed up on the default backup device.
2. To back up an entire non-replicated file system:
/etc/backup -0 -u /xyz
The "-0" level and the "/xyz" cause the system to back up the "/xyz"
system. The file system "/xyz" and other mounted file systems are not
backed up.
The file system is backed up to the default device defined in the backupdev
entry in the /etc/filesystems file. Otherwise, the files are backed up to
the /dev/rfd0 file. The "-u" flag causes the system to update the current
Processed November 8, 1990 BACKUP(8,C) 4
BACKUP(8,C) AIX Commands Reference BACKUP(8,C)
backup level record in the /etc/budate file. Only the root file system is
backed up; mounted file systems are not.
3. To back up all files modified since the last level 0 backup:
/etc/backup -1 -u /xyz
4. To back up an entire minidisk:
/etc/backup -mf/dev/rmt1 /
This command backs up the entire minidisk that contains the root file
system. The "-f" flag causes the system to backup the minidisk to the
streaming tape on "/dev/rmt1" instead of backing up to the default device.
The "-m" flag must be used when backing up replicated file systems in order
to retain commit counts.
5. To improve performance on the streaming tape, pipe the backup command to
the dd command:
backup -if- -C28 | dd of=/dev/rmt0 bs=28k
The backup command backs up specific files ("-i"), directs the output to
the standard output device ("f-"), and specifies an output size as 28
blocks ("-C28"). The output is piped to the dd command. The dd command
copies the files to an output file, which is a streaming tape device
("of=/dev/rmt0") and specifies a file size of 28 blocks ("bs=28b"). The
file size in both commands must be the same. To restore these files, pipe
the dd command to the restore command. The number of blocks specified in
the backup option must not exceed the number of blocks available on the
tape. Otherwise, even though there is no error message, not all of the
data is backed up since the dd command does not work with multiple tapes.
6. To back up all files modified since the last level 0 backup to 450-foot
tapes with a density of 350 bytes per inch:
backup -d 350 -s 4050 -l -u /
7. To back up all files modified since the last level 0 backup to 600-foot
tapes, using the default density of 700 bytes per inch:
backup -s 5400 -l -u /
8. To back up all files modified since the last level 0 backup to a DC 300
XL/P 450-foot, 310 oersted tape:
backup -d 800 -s 450 -l -u /
FILES
/etc/filesystems Read for default parameters.
/etc/budate Log for most recent backup dates.
Processed November 8, 1990 BACKUP(8,C) 5
BACKUP(8,C) AIX Commands Reference BACKUP(8,C)
/dev/rfd0 Default backup device.
/dev/rroot Default file system.
RELATED INFORMATION
See the following commands: "find," "format, fdformat," "print," "restore"
and "sh, Rsh."
See the backup and filesystems files and the tape special file in AIX Operating
System Technical Reference.
See "Backing Up Files and File systems" in Managing the AIX Operating System.
Processed November 8, 1990 BACKUP(8,C) 6