Summary: simple (?) script help

From: Gosselin, Mark <gosselinm_at_netscout.com>
Date: Wed Mar 03 2004 - 12:13:38 EST
Thanks to everyone who responded (and there were a ton of you).

My situation doesn't lend itself to two different cron jobs all that well, so
I used a combination of suggestions to get a script that looks something like
this:

....

MINS=`date "+%M"` ; export MINS
echo $MINS
HR=`date "+%H"` ; export HR
echo $HR
 if [ "${MINS}" -eq 00 ]
 then
        # 0 minutes
        if ( $HR == 00 || 06 || 12 || 18 ) then
                ...
        echo Checked hour
          else   # any other hour
        echo Not an hour divisible by 6
          else   # any other hour
        echo Not an hour divisible by 6
          fi
 else
        # any other minute
 fi

Thanks!!!

Mark Gosselin
NetScout Systems

_____________________________________________________________________________
____

Original Post:

Hi all,

I'm writing a script and am having a mental block with respect to one
aspect
of it....

Here's the scenario:

I run a cronjob that performs a certain task every 5 minutes.... I need to
continue doing that, but at specified times (say midnight, 6am, noon, and
6pm), I want to do a separate task...

What I'm looking for is a good way to parse the output of the 'date'
command
so that I can look at the minute. If the minutes are equal to 00, then I
want
to look at the hour and see if it equals 00, 06, 12, or 18...

Anyone got an easy way to do this???

All help is most welcome.

Mark Gosselin
NetScout Systems
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Wed Mar 3 12:13:21 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:26 EST