#!/bin/sh
#  $Id: sbc_restore_post,v 1.1 2007/11/16 22:24:18 sesam Exp $
#===============================================================================
#
#           SESAM RESTORE POST procedure for UNIX clients
#
#===============================================================================
#
# Description: This script is called from SESAM after backup has 
#              finished; it gives the user a possibility to do 
#              some special actions after restore
#              ( restart databases, send messages etc. ).
#
#              It is called with 12 parameters from the current SESAM backup:
#
#                $1 = Restore task
#                $3 = Overwrite or not (y|n)
#                $4 = Selectiv or full restore (s|f)
#                $5 = Restore target
#                $6 = Backup task 
#                $8 = Sesam day
#                $9 = Saveset ID
#                10 = Tape server interface
#                13 = Status of restore
#                14 = Message from restore
#
#               Returning status:
#                 if this procedure ran OK
#                 then "exit 0"
#                 else "exit 1" (>0)
#               Message can be set by
#                 echo "STATUS=ERROR MSG=Message text"
# >>> This is a user programmable procedure <<<
#
#


#=== Print call arguments =====================================

restore_task=$1
over=$2
source=$3 
fullsel=$4
treeplain=$5
target=$6
task=$7
sesamdate=$8
saveset=$9
tape_server=${10}
status=${12}
msg=${13}

echo restore task   = $restore_task
echo source         = $source
echo target         = $tape_server
echo task           = $task
echo saveset        = $saveset
echo status         = $status
echo sesam_date     = $sesamdate
echo msg            = $msg


#=== Please insert your specific actions here =====================================
# Example: Make a diff between backup source and restored data
# diff -r "${source}" "${target}${source}"
# if [ "$?" != "0" ];then
#   echo "STATUS=ERROR MSG=Files differ"
#   exit 2
# fi
echo STATUS=SUCCESS MSG=OK
exit 0
