Professional Documents
Culture Documents
################################################################################
#####################
#
#
# Program Name : OverRunningJobs.sh
#
# Author : Atul Singh
#
# Purpose : This script will monitor the Jobs that are running for a time
duration that is #
# more than the last run time.
#
# Version : 1.0
#
# Date : 30th Nov 2015
# Blog : www.datagenx.net
#
#
#
#
#
################################################################################
#####################
. /etl/apps/DS/InformationServer/Server/DSEngine/dsenv
#### DO ARCHIVE ####
do_archive()
{
foldername="Archive"
if [ -e $foldername ] && [ -d $foldername ]
then
c=`find ./Attention -name "Attention_*"|wc -l`
let count=c
echo $count
if [ $count -gt 0 ]
then
`mv Attention/Attention_* Archive`
else
## No files to archive
fi
else
`mkdir Archive`
`mv Attention/Attention_* Archive`
fi
echo "\n** Previous Log Files have been sent to Archive **\n"
}
filemail="Mail_List.txt"
if [ -f $filemail ]
then
strmail=`cat Mail_List.txt|tr '\n' ' '`
else
echo "**** Mail_List file doesnot exist *****\n\n "
exit 1 ##exit shell script
fi
### CONCATENATE ALL THE ATTENTION FILES TO A SINGLE MAIL FILE ###