Results 1 to 3 of 3

Thread: task

  1. #1
    Join Date
    Jun 2004
    Posts
    46

    Unanswered: 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

  2. #2
    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

  3. #3
    Join Date
    Jun 2004
    Posts
    20
    plug in the Paging related command .

    Jc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •