In the example below, I am backing up 3 jobs in 2 batches as follows:
- On its own
- 2650_FullBackup_6Stream_4week_ret.arc
- The following two in parallel
- 2650_FullBackup_2Stream_4week_ret.arc
- TD_5550_FULLBACKUP_4STR.arc
Run this from the command line like this:
/usr/local/bin/run_tara_job.ksh DEBUG=0 JOB_NAME=2650_FullBackup_6Stream_4week_ret.arc#:2650_FullBackup_2Stream_4week_ret.arc:TD_5550_FULLBACKUP_4STR.arc# >/var/misc/log/run_tara_job.log 2>&1
Or set up a cron job like this:
0 19 19 7 * /usr/local/bin/run_tara_job.ksh DEBUG=0 JOB_NAME=2650_FullBackup_6Stream_4week_ret.arc#:2650_FullBackup_2Stream_4week_ret.arc:TD_5550_FULLBACKUP_4STR.arc# >/var/misc/log/run_tara_job.log 2>&1
Note - you will need the Job Names from the Tara scripts (typically find these in /opt/teradata/tara/server/sr directory) or from the Tara GUI.
#!/bin/ksh -x
# Program: run_tara_job.ksh
# Description: Run Tara backup job.
# Parameters: JOB_NAME=
# Version: 0.1 gml 19-Jul-2011 Initial version
SEP=":"
SUBSEP="#" # take care not to pick a delimiter that interferes with greps
DEBUG=0
eval $@
BKP_ROOT_DIR=/opt/teradata/tara/server/bin
TARA_BKP_PASSWD_FILE=/opt/teradata/tara/server/bin/tara.pwd
if [ -z "$JOB_NAME" ]
then
echo "ERROR: No JOB_NAME arg. It is mandatory"
exit 1
fi
JOB_NAME=`echo $JOB_NAME | tr "$SEP" " "`
cd $BKP_ROOT_DIR
#exit 0
for JOB in `echo $JOB_NAME`
do
WAIT_FLAG=`echo $JOB | grep -c "\${SUBSEP}"`
if [ $WAIT_FLAG -gt 0 ]
then
JOB=`echo $JOB | tr -d "$SUBSEP"`
echo $JOB
fi
echo "Starting job $JOB at `date`"
# note -w will wait for tara job to complete fully
if [ $DEBUG -eq 0 ]
then
./taralaunch -u administrator -e $TARA_BKP_PASSWD_FILE -j $JOB -w &
else
echo "./taralaunch -u administrator -e $TARA_BKP_PASSWD_FILE -j $JOB -w" &
fi
if [ $WAIT_FLAG -gt 0 ]
then
wait
fi
done