07-30-2008
10,
0
Join Date: Apr 2008
Last Activity: 6 August 2008, 12:43 AM EDT
Posts: 10
Thanks Given: 0
Thanked 0 Times in 0 Posts
Please need immediate help with script.
Hi ,
Please need help with the following script, its just looping through one file. I shall paste the script and the output as well.
Appreciate your help.
echo "Wait for the lock file in the Landing folder"
for i in $zip_files RTMSJBDB RTMSS2DB RTMSSIDB RTMSKADB RTMSFKDB RTMSDADB RTMSDEDB RTMSCLYC RTMSCNTS;do
if [[ -a $STAGE_DIR/$i.lck ]]; then
echo " Found the lock file at $(date)"
else
start=$SECONDS
echo " Start check for $STAGE_DIR/$i.lck at $(date)."
while [[ ! -a $STAGE_DIR/$i.lck ]]
do
current=$SECONDS
if [[ $current-$start -ge 2 ]]; then
status="WARNING DEV $STAGE_DIR/z.ksh at $(date)."
status="$status Waiting for the file to arrive."
message="The $STAGE_DIR/$i.lck lock file has not arrived yet."
echo "$status"
echo "$message"
$DEBUG /code/utils/mailit.ksh -sub "$status" \
-msg "$message" \
-from $operator \
-to "$operator,$im_owners,$app_owners"
start=$SECONDS
fi
sleep 60
done
fi
chk_rtn mv $STAGE_DIR/$i.zip $STAGE_DIR/failed/$i.zip
chk_rtn rm $STAGE_DIR/$i.lck
done
OUTPUT:
Wait for the lock file in the Landing folder
Start check for /work/ia94086/RTMSJBDB.lck at Wed Jul 30 14:28:09 CDT 2008.
WARNING DEV /work/ia94086/z.ksh at Wed Jul 30 14:29:10 CDT 2008. Waiting for the file to arrive.
The /work/ia94086/RTMSJBDB.lck lock file has not arrived yet.
Message: The /work/ia94086/RTMSJBDB.lck lock file has not arrived yet.
Sent to: Unavailable,,
From: Unavailable
Regarding: WARNING DEV /work/ia94086/z.ksh at Wed Jul 30 14:29:10 CDT 2008. Waiting for the file to arrive.
WARNING DEV /work/ia94086/z.ksh at Wed Jul 30 14:30:10 CDT 2008. Waiting for the file to arrive.
The /work/ia94086/RTMSJBDB.lck lock file has not arrived yet.
Message: The /work/ia94086/RTMSJBDB.lck lock file has not arrived yet.
Sent to: Unavailable,,
From: Unavailable
Regarding: WARNING DEV /work/ia94086/z.ksh at Wed Jul 30 14:30:10 CDT 2008. Waiting for the file to arrive.
WARNING DEV /work/ia94086/z.ksh at Wed Jul 30 14:31:11 CDT 2008. Waiting for the file to arrive.
The /work/ia94086/RTMSJBDB.lck lock file has not arrived yet.
Message: The /work/ia94086/RTMSJBDB.lck lock file has not arrived yet.
Sent to: Unavailable,,
From: Unavailable
Regarding: WARNING DEV /work/ia94086/z.ksh at Wed Jul 30 14:31:11 CDT 2008. Waiting for the file to arrive.
WARNING DEV /work/ia94086/z.ksh at Wed Jul 30 14:32:12 CDT 2008. Waiting for the file to arrive.
The /work/ia94086/RTMSJBDB.lck lock file has not arrived yet.
Message: The /work/ia94086/RTMSJBDB.lck lock file has not arrived yet.
Sent to: Unavailable,,
From: Unavailable
Regarding: WARNING DEV /work/ia94086/z.ksh at Wed Jul 30 14:32:12 CDT 2008. Waiting for the file to arrive.
Thanks,
dsrules.