Hi,
First of all merry christmas and Happy holidays to all
My situation is as below,
When a backup job runs on a mainframe server, it creates a 0byte file on a network drive which is accessible through linux
Linux server : Red Hat Enterprise Linux Server release 5.3 Beta (Tikanga)
File : /ntwrk/common/backup_in_progress.txt
Once the backup job is complete the file is removed.
To monitor the backup timings I made two shell scripts as below
#chk_job_start.sh <------ to catch start time
#/bin/bash
while [ 0 ]
do
#if 0b file exists
if [ -e /ntwrk/common/backup_in_progress.txt ]
then
#Record the start time
tm=`date "%H%M"`
echo "$tm" > /home/sam/Backup_Started
#initiate job2
/bin/bash chk_job_end.sh &
#exit
exit 0
else
#loop every 10 secs unless the 0b file is found
sleep 10
fi
#chk_job_end.sh
#!/bin/bash
while [ 0 ]
do
#if 0b file still exists
if [ -e /ntwrk/common/backup_in_progress.txt ]
then
#loop every 10 secs unless the 0b file is not found
sleep 3
else
#Record the finish time
tm=`date "+%Y%m%d %H%M"`
echo "$tm" > /home/sam/Backup_Finished
#exit
exit 0
fi
done
I am running job start script through cron as
01 00 * * * /bin/bash /home/sam/chk_job_strt.sh
Problem is the 2nd script(chk_job_end.sh) never get's executed.
When I test this outside cron, the test results are proper i.e. both scripts are executed and time is recorded.
Plz help.
Thanks
Sam