The following sample conf_tape_device files show how you might structure configuration files for stackers, jukeboxes, or file dumps. They are examples only and are not recommendations.
There are two general considerations concerning the conf_tape_device files (these considerations are discussed in detail in The MOUNT Parameter), as follows:
1. The Backup System passes the following parameters to the conf_tape_device file:
· The tape device path name
· The tape operation
· The number of times the tape has been requested
· The tape name
· The dump ID
2. The Backup System responds to exit codes from the conf_tape_device file in the following ways:
Exit code 0 - Continue the backup process.
Exit code 1 - Abort the backup process.
Any other exit code - Prompt the operator for the correct tape.
Sample conf_Vtape_device File for Stackers
The following is an example of a configuration file for dealing with stacker-type automated backup equipment:
AUTOQUERY NO
ASK YES
MOUNT /opt/backup/stacker0.1
NAME_CHECK NO
This file specifies the following:
· The AUTOQUERY parameter tells the Backup System not to prompt the operator to mount the first tape.
· The ASK parameter tells the Backup System to prompt the operator when an error occurs during the backup process.
· The MOUNT parameter tells the Backup System to call the file /opt/backup/stacker0.1 and execute the routine in that file to initialize the stacker.
· The NAME_CHECK parameter tells the Backup System not to ensure that the name of the next tape in the stack matches the dump set name.
The previous example calls the /opt/backup/stacker0.1 file to initialize the stacker and load a tape. The following is an example of the routine that might be contained in that file:
#! /bin/csh -f
set devicefile = $1
set operation = $2
set trys = $3
set tapename = $4
set tapeid =
$5
set exit_continue = 0
set exit_abort = 1
set exit_interactive = 2
#
-------------------------------------------------
if ($trys) > 1) then
echo "Too many tries"
exit $(exit_interactive)
endif
if ((${operation} == "dump") |\
(${operation) == "savedb")} then
stCmd_NextTape &(devicefile)
if (${status} != 0) exit ${exit_interactive}
echo "Will continue"
exit $(exit_continue)
endif
if ((${operation} ==
"labeltape")
(${operation} == "readlabel")) then
echo "Will continue"
exit ${exit_continue}
endif
echo
"Prompt for tape"
exit ${exit_interactive}
This routine makes use of only two of the parameters passed to it by the Backup System: trys and operation. It is a good practice to watch the number of attempts and exit if it exceeds one (which implies that the stacker is out of tapes). Note that this routine calls stCmd_NextTape for dump or savedb operations; however, your file should call whatever routine is required to load the next tape for your stacker. Also note that the routine sets the appropriate exit code to prompt an operator to load a tape if either the stacker cannot load a tape or a restore operation is in process.
Sample conf_Vtape_device File for Jukeboxes
The following sample conf_tape_device file configures the Backup System to dump directly to a file.
MOUNT /opt/backup/jukebox0.1
UNMOUNT /opt/backup/jukebox0.1
ASK NO
NAME_CHECK NO
This file specifies the following:
· The MOUNT parameter tells the Backup System to call the file /opt/backup/jukebox0.1 and execute the routine in that file to mount a tape.
· When the Backup System closes a tape device, it calls the file /opt/backup/jukebox0.1 and executes the routine to remove the tape from the jukebox.
· The ASK parameter tells the Backup System not to prompt the operator for the initial tape.
· The NAME_CHECK parameter tells the Backup System not to ensure that the name of the next tape in the stack matches the dump set name.
The following sample conf_tape_device file shows the use of the trys and operation parameters:
#! /bin/csh -f
set devicefile = $1
set operation = $2
set trys = $3
set tapename = $4
set tapeid =
$5
set exit_continue = 0
set exit_abort = 1
set exit_interactive = 2
#
-------------------------------------------------
if ($trys) > 1) then
echo "Too many tries"
exit $(exit_interactive)
endif
if ((${operation} == "labeltape")
(${operation} == "readlabel")) then
echo "Won't read or write a tape label"
exit
${exit_abort}
endif
if ((${operation} == "unmount" then
jbComd_UnMountTape $(devicefile)
exit
endif
This routine makes use of two of the parameters passed to it by the Backup System: trys and operation. The trys parameter monitors the number of attempts to load a tape. If the number of attempts exceeds one, the jukebox is unable to load a tape and the routine will exit and return an exit code of 2 (which will cause the Backup System to prompt the operator to load a tape.)
In this scenario, tape names are not checked before using a tape as part of a dump set (recall that the NAME_CHECK parameter was set to NO, disabling tape name checking). Therefore, if the labeltape or readlabel operations are attempted the routine echoes a message saying that these operations cannot be performed. The executable routine then returns an exit code of 1, which causes the Backup System to abort the operation.
If an unmount is executed, the routine calls the jbComd_UnMountTape function to remove the tape from the drive.
Sample conf_Vtape_device File for Dump to File
The following sample conf_tape_device configures the Backup System to dump directly to a file.
MOUNT /opt/backup/file
FILE YES
This file specifies the following:
· The MOUNT parameter calls an executable routine in the /opt/backup/file file.
· The FILE parameter is set to YES, indicating that the information should be dumped directly to a file. The pathname for the target dump file is set in the dcelocal/var/dfs/backup/TapeConfig file.
The following is an example of a routine that might be contained in the /opt/backup/file that demonstrates how to configure the Backup System to handle dumps to a file:
#! /bin/csh -f
set devicefile = $1
set operation = $2
set trys = $3
set tapename = $4
set tapeid =
$5
set exit_continue = 0
set exit_abort = 1
set exit_interactive = 2
#
-------------------------------------------------
if ($trys) > 1) then
echo "Too many tries"
exit $(exit_interactive)
endif
if ((${operation} == "labeltape")
echo "Won't label a tape/file"
exit ${exit_abort}
endif
if ((${operation} == "dump") | \
(${operation} ==
"restore") | \
(${operation} == "savedb") | \
(${operation} == "restoredb")) then
/bin/rm -f
$(devicefile)
/bin/ln -s /hsm/${tapename}_$(tapeid) ${devicefile}
if ($(status) != 0) exit ${exit_abort}
endif
exit ${exit_continue}
This routine makes use of only two of the parameters passed to it by the Backup System: trys and operation. The trys parameter monitors the number of attempts to write to or read from a file. If the number of attempts exceeds one, the Backup System is unable to write to read from the file specified in the dcelocal/var/dfs/backup/TapeConfig file. The routine the exits and returns an exit code of 2 (which causes the Backup System to prompt the operator to load a tape). The operator can use this opportunity to change the name of the file specified in the dcelocal/var/dfs/backup/TapeConfig file.
In this scenario, tape names are not checked before using a tape as part of a dump set (recall that the NAME_CHECK parameter was set to NO, disabling tape name checking). Therefore, if the labeltape and readlabel operations are attempted, the sample routine echoes a message saying that these operations cannot be performed. The executable routine then returns an exit code of 1, which causes the Backup System to abort the operation.
A dump, restore, savedb, or restoredb operation links to a new file using the tapename and tapeid to build the file name. The tapename and tapeid are used so that restore operations can easily link to the proper file.