[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The file ‘backup-specs’ specifies backup parameters for the
backup and restoration scripts provided with tar
. You must
edit ‘backup-specs’ to fit your system configuration and schedule
before using these scripts.
Syntactically, ‘backup-specs’ is a shell script, containing
mainly variable assignments. However, any valid shell construct
is allowed in this file. Particularly, you may wish to define
functions within that script (e.g., see RESTORE_BEGIN
below).
For more information about shell script syntax, please refer to
the definition of the Shell Command Language. See also
Bash Features in Bash Reference Manual.
The shell variables controlling behavior of backup
and
restore
are described in the following subsections.
5.4.1 General-Purpose Variables | ||
5.4.2 Magnetic Tape Control | ||
5.4.3 User Hooks | ||
5.4.4 An Example Text of ‘Backup-specs’ |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The user name of the backup administrator. Backup
scripts
sends a backup report to this address.
The hour at which the backups are done. This can be a number from 0 to 23, or the time specification in form hours:minutes, or the string ‘now’.
This variable is used by backup
. Its value may be overridden
using ‘--time’ option (see section Using the Backup Scripts).
The device tar
writes the archive to. If TAPE_FILE
is a remote archive (see remote-dev), backup script will suppose
that your mt
is able to access remote devices. If RSH
(see RSH) is set, ‘--rsh-command’ option will be added to
invocations of mt
.
The blocking factor tar
will use when writing the dump archive.
See section The Blocking Factor of an Archive.
A list of file systems to be dumped (for backup
), or restored
(for restore
). You can include any directory
name in the list — subdirectories on that file system will be
included, regardless of how they may look to other networked machines.
Subdirectories on other file systems will be ignored.
The host name specifies which host to run tar
on, and should
normally be the host that actually contains the file system. However,
the host machine must have GNU tar
installed, and
must be able to access the directory containing the backup scripts and
their support files using the same file name that is used on the
machine where the scripts are run (i.e., what pwd
will print
when in that directory on that machine). If the host that contains
the file system does not have this capability, you can specify another
host as long as it can access the file system through NFS.
If the list of file systems is very long you may wish to put it
in a separate file. This file is usually named
‘/etc/backup/dirs’, but this name may be overridden in
‘backup-specs’ using DIRLIST
variable.
The name of the file that contains a list of file systems to backup or restore. By default it is ‘/etc/backup/dirs’.
A list of individual files to be dumped (for backup
), or restored
(for restore
). These should be accessible from the machine on
which the backup script is run.
If the list of individual files is very long you may wish to store it
in a separate file. This file is usually named
‘/etc/backup/files’, but this name may be overridden in
‘backup-specs’ using FILELIST
variable.
The name of the file that contains a list of individual files to backup or restore. By default it is ‘/etc/backup/files’.
Full file name of mt
binary.
Full file name of rsh
binary or its equivalent. You may wish to
set it to ssh
, to improve security. In this case you will have
to use public key authentication.
Full file name of rsh
binary on remote machines. This will
be passed via ‘--rsh-command’ option to the remote invocation
of GNU tar
.
Name of temporary file to hold volume numbers. This needs to be accessible by all the machines which have file systems to be dumped.
Name of exclude file list. An exclude file list is a file located on the remote machine and containing the list of files to be excluded from the backup. Exclude file lists are searched in /etc/tar-backup directory. A common use for exclude file lists is to exclude files containing security-sensitive information (e.g., ‘/etc/shadow’ from backups).
This variable affects only backup
.
Time to sleep between dumps of any two successive file systems
This variable affects only backup
.
Script to be run when it’s time to insert a new tape in for the next
volume. Administrators may want to tailor this script for their site.
If this variable isn’t set, GNU tar
will display its built-in
prompt, and will expect confirmation from the console. For the
description of the default prompt, see change volume prompt.
Message to display on the terminal while waiting for dump time. Usually this will just be some literal text.
Full file name of the GNU tar
executable. If this is not set, backup
scripts will search tar
in the current shell path.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Backup scripts access tape device using special hook functions. These functions take a single argument — the name of the tape device. Their names are kept in the following variables:
The name of begin function. This function is called before accessing the drive. By default it retensions the tape:
MT_BEGIN=mt_begin mt_begin() { mt -f "$1" retension }
The name of rewind function. The default definition is as follows:
MT_REWIND=mt_rewind mt_rewind() { mt -f "$1" rewind }
The name of the function switching the tape off line. By default it is defined as follows:
MT_OFFLINE=mt_offline mt_offline() { mt -f "$1" offl }
The name of the function used to obtain the status of the archive device, including error count. Default definition:
MT_STATUS=mt_status mt_status() { mt -f "$1" status }
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
User hooks are shell functions executed before and after
each tar
invocation. Thus, there are backup
hooks, which are executed before and after dumping each file
system, and restore hooks, executed before and
after restoring a file system. Each user hook is a shell function
taking four arguments:
Its arguments are:
Current backup or restore level.
Name or IP address of the host machine being dumped or restored.
Full file name of the file system being dumped or restored.
File system name with directory separators replaced with colons. This is useful, e.g., for creating unique files.
Following variables keep the names of user hook functions:
Dump begin function. It is executed before dumping the file system.
Executed after dumping the file system.
Executed before restoring the file system.
Executed after restoring the file system.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following is an example of ‘backup-specs’:
# site-specific parameters for file system backup. ADMINISTRATOR=friedman BACKUP_HOUR=1 TAPE_FILE=/dev/nrsmt0 # Usessh
instead of the less securersh
RSH=/usr/bin/ssh RSH_COMMAND=/usr/bin/ssh # Override MT_STATUS function: my_status() { mts -t $TAPE_FILE } MT_STATUS=my_status # Disable MT_OFFLINE function MT_OFFLINE=: BLOCKING=124 BACKUP_DIRS=" albert:/fs/fsf apple-gunkies:/gd albert:/fs/gd2 albert:/fs/gp geech:/usr/jla churchy:/usr/roland albert:/ albert:/usr apple-gunkies:/ apple-gunkies:/usr gnu:/hack gnu:/u apple-gunkies:/com/mailer/gnu apple-gunkies:/com/archive/gnu" BACKUP_FILES="/com/mailer/aliases /com/mailer/league*[a-z]"
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] |
This document was generated on August 23, 2023 using texi2html 5.0.