#!/bin/sh
#  $Id: sbc_pre,v 1.4 2003/09/22 11:18:16 psl Exp $
#=============================================================================
#
#           SESAM PRE procedure for UNIX clients
#
#=============================================================================
#
# Description: This procedure is called from SESAM before backup is started;
#              it gives the user a possibility to do some special things before 
#              backup ( prepare databases, send messages etc. ).
#
#              It is called with 10 parameters from the current SESAM backup:
#
#        	 $1 = Backup source 
#                $2 = Tape server interface
#                $3 = Task name
#                $4 = Drive number
#                $5 = Type of backup C_opy, F_ull, D_ifferential, I_ncremental
#                $6 = Execution counter (deprecated)
#                $7 = Saveset ID
#                $8 = Label of used media
#                $9 = Name of mediapool
#                $10= Schedule
#
#               Returning status:
#                exit with = 0 if this procedure ran OK
#                else with > 0
#
# >>> This is a user programmable procedure <<<
#
#=============================================================================

#=== Print call arguments =====================================
source=$1 
tape_server=$2
task=$3
drive_number=$4
backup_type=$5
exe_cnt=$6
saveset=$7
label=$8
pool=$9
shift
schedule=$9

echo source       = $source
echo tape_server  = $tape_server
echo task         = $task
echo drive_number = $drive_number
echo backup_type  = $backup_type
echo exe_cnt      = $exe_cnt
echo saveset      = $saveset
echo label        = $label
echo pool         = $pool
echo schedule     = $schedule

#=== Please insert your specific actions here=====================================

#if [ "$task" == "task-with-pre" ]
#then 
#echo "STATUS=SUCCESS MSG=PRE operation OK"
#exit 0
#fi

#if [ "$task" == "task-with-pre-error" ]
#then 
#echo "STATUS=ERROR MSG=PRE operation failed"
#exit 2
#fi

exit 0
