# 
# Ed Silva
#
# (c)2010 Ericsson 
#
# Version 1.0 4-7-2010 initial code
# Version 1.1 4-21-2010 rename scripts
# Version 1.2 5-24-2010 remove commonplatform dependency
#			bug fixing of san_check and san_free.
# Version 1.3 5-27-2010 hard coded path for CMS
#			
# Version 1.4 5-28-2010 CB_APP logic changed it uses
#                       ${BAK_CONF_DIR}/<app>.
#			
# Version 1.5 5-29-2010 updated san_check();
#                       
# Version 1.6 5-30-2010 re-wrote san_check();
#
# Version 1.7 5-30-2010 added dir condition for
#
# Version 2.0 10-14-2010 inital code based off V1.7
#
############
############

COMMON_BACKUP_DIR="/usr/local/platform/backup"
BAK_DIR="${COMMON_BACKUP_DIR}/archives/"

DIR_FIELD=":"

################################################
#
#
# Check for at least one argument...
# and a maximum of 12. The maximum can be
# edited but must be at least "1"
#

MAX_ARGS="6"

# 
# TMP files with PID
#
CB_PID="$$"
TAR_TMP="/tmp/tar.tmp.${CB_PID}"
SIZE_TMP="/tmp/size.tmp.${CB_PID}"
ARGS_TMP="/tmp/args.tmp.${CB_PID}"
CB_RAMDOM="/tmp/cb.ramdom.tmp.${CB_PID}"
DU_TMP="/tmp/du.tmp.${CB_PID}"
MAIL_WARN_TMP="/tmp/mail.warn.tmp.${CB_PID}"
MAIL_TMP="/tmp/mail.tmp.${CB_PID}"
BAK_ERROR_DIR="${COMMON_BACKUP_DIR}/error"

#
# Tar flags
# c create
# z run thru gzip
# v verbose
# f filename
#

M_TAR="/bin/tar -c -z -f "
V_TAR="/bin/tar -d -f "

#
# UNIX Commands
#

CB_GZIP="/usr/bin/gzip"
CB_MOUNT="/bin/mount"
CB_MV="/bin/mv"
CB_DU="/usr/bin/du"
CB_LS="/bin/ls"
CB_CP="/bin/cp"
CB_CUT="/usr/bin/cut"
CB_TR="/usr/bin/tr"
CB_UNIQ="/usr/bin/uniq"
CB_SORT="/usr/bin/sort"
CB_DF="/bin/df"
CB_TAIL="/usr/bin/tail"
CB_EGREP="/usr/bin/egrep"
CB_ECHO="/bin/echo"
CB_CAT="/bin/cat"
CB_WC="/usr/bin/wc"
CB_RM="/bin/rm"
CB_AWK="/usr/bin/awk"
CB_SED="/usr/bin/sed"
CB_PASTE="/usr/bin/paste"
CB_STAT="/usr/bin/stat"
MAIL_IT="/usr/bin/mutt"

#
# List of mail recipients or alias
# UNIX admin must have configured postfix
# in order for email notifications to work
#
BAK_ADMIN="vikram.madhava.rao@ericsson.com"
#
# Date, year, day of the month and month.
#

M_DATE=`date`
M_YEAR=`date +%Y`
M_MDAY=`date +%d`
M_MONTH=`date +%m`
M_WDAY=`date +%a`
M_HOUR=`date +%H`
M_MIN=`date +%M`

BAK_DATE="${M_YEAR}${M_MONTH}${M_MDAY}"
BAK_TIME="${M_HOUR}${M_MIN}"

BAK_START="${M_DATE}"
BAK_END="${M_DATE}"

BAK_CONF_DIR="${COMMON_BACKUP_DIR}/conf"

#
# Set Full path to SAN mount point. This will be given 
# by UNIX admin and NFS or samba must have already be setup
#

SAN="/content/temp"

#
# Hostname (nodename)
#
M_UNAME=`cmsapp-49-162`

#
# Set to eth0/bond0 or the IP attached to the SAN
#

M_IFCONFIG="10.116.49.162"

#
# Hostname(nodename) plus IP address
#

M_HNAME="${M_UNAME}_${M_IFCONFIG}"

#
# Set to application running on server
# it must match the directory /usr/local/platform/backup/conf/<app-dir>
#

CB_APP="cms"

#####
##### END
#####
