Using the interactive option allows you to run BRU from cron (cron runs programs at specified times and frequencies). If no interaction with the user is required, running from cron is no different than running directly from a terminal. However, when interaction is necessary there are basically two options; terminate, or find some way to communicate with the operator (or another program masquerading as the operator). The -B option provides for simple termination while the -I option provides for communication with an operator. BRU recognizes the following parameters for the -I option:
b default fifos
q,fifoname1 write queries to a fifo
r,fifoname2 read responses from a fifo
l,filename write log information to a file
You can use the device cycling feature to specify that more than one archive device contains tapes that are ready for a nightly backup. For example, an operator might load a set of tapes onto several drives, and schedule cron to begin a daily backup at midnight, when all of the programmers and office staff have gone home. BRU will do as much work as it can without interaction, and then wait patiently for an operator to provide additional information in the morning. As an example, assume that the crontab file contains the following crontab entry:
30 02 * * * sh -c /etc/dailybru /usr
and the file /etc/dailybru contains:
# Backup the specified files.
# Use fifos to communicate if necessary.
DEVS=’-f tape0 -f tape1’
bru -c $IOPS $DEVS $FILES 2>/etc/dailybru.log
where tape0 and tape1 are tape units that the operator loads before leaving.
Every day at 2:30 a.m., cron will run the /etc/dailybru script, causing BRU to begin backing up all files and subdirectories under /usr. BRU will continue to run until it finishes or until it hits the end of the tape in tape1, at which point it will wait for the operator to communicate with it via the fifos /bru/bru.r and /bru/bru.q. The file /etc/dailybru.log will contain any warnings or error messages issued by BRU.
This use of device cycling allows BRU to use multiple devices without the operator’s presence being required. When BRU runs out of space on the first volume, instead of the operator (who has gone home) having to physically mount another volume, BRU automatically switches to a different volume, physically mounted elsewhere, to continue the archive creation operation.