If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > task

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-23-04, 14:22
markjason markjason is offline
Registered User
 
Join Date: Jun 2004
Posts: 46
task

Hi all!

How can i do the following task ,
Actually my task is to check if a file exists in a particular directory
at
7:15 pm every night. This file may or may not be in this directory , so
the
program should repeat this check every 20 minutes. It should stop this
checking at 9:15 pm and send out a pager saying that the file does not
exist in the directory


any help is appreciated.
Thanks
Mark
Reply With Quote
  #2 (permalink)  
Old 08-24-04, 05:17
srsjc srsjc is offline
Registered User
 
Join Date: Jun 2004
Posts: 20
Hi ,

jus schedule this script to execte daily at 7:15 P.M using crontab.

sleep_time=20
while [ ! -f fileName ]
do
if [ $sleep_time -gt 120 ]
then
echo -n "page me :: "
echo "No mails even after 2 hours"
exit 2
else
sleep_time=`expr $sleep_time + 20`
echo "waiting for 20 more minutes...."
sleep 20m
fi
done


HTH,
bye
Jc
Reply With Quote
  #3 (permalink)  
Old 08-24-04, 05:19
srsjc srsjc is offline
Registered User
 
Join Date: Jun 2004
Posts: 20
plug in the Paging related command .

Jc
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On