Groups > Unix Linux > Linux discussions > Re: Cron syntax help...




Re: Cron syntax help...

Re: Cron syntax help...
Wed, 05 Mar 2008 08:04:01 +010
Ivan Marsh wrote:

> On Tue, 04 Mar 2008 19:36:14 +0100, Walter Mautner wrote:
> 
>> Douglas O'Neal wrote:
>> 
>>> On 03/04/08 12:11, Ivan Marsh wrote:
>>>> Hey folks,
>>>> 
>>>> How do I set up a cron job to execute a script every fifteen
minutes
>>>> of the day except for between the hours of midnight and seven
AM?
>>>> 
>>>> thx-
>>>> 
>>>> 
>>> 15 7-23 * * * echo "run at 15 minutes past the hour,
8am-11pm"
>> 
>> Nay. That would go
>> 0,15,30,45 7-23 * * *
>> or shorter
>> */15 7-23 * * *
> 
> Okay... some clarification please.
> 
man 5 crontab will clarify everything :)

> Which of those runs every fifteen minutes, but doesn't run at all between
> midnight and seven AM?
>
The first one from  Douglas O'Neal will run every 15'th minute after the
full hour (only once per hour).
My two variants will do run every 15 minutes, and from 7-23. Uhm, maybe up
to 23:45 ... 

> I'm trying to set something up that should check status of a system every
> fifteen minutes during business hours and send an alarm if there's an
> issue. But, unlike me, the people that will respond to this alarm aren't
> available 24/7.
> 
Ever thought about nagios?
-- 
vista policy violation: Microsoft optical mouse found penguin patterns 
 on mousepad. Partition scan in progress to remove offending 
 incompatible products.  Reactivate MS software. 
Post Reply
Re: Cron syntax help...
Wed, 05 Mar 2008 15:17:26 -060
On Wed, 05 Mar 2008 08:04:01 +0100, Walter Mautner wrote:

> Ivan Marsh wrote:
> 
>> On Tue, 04 Mar 2008 19:36:14 +0100, Walter Mautner wrote:
>> 
>>> Douglas O'Neal wrote:
>>> 
>>>> On 03/04/08 12:11, Ivan Marsh wrote:
>>>>> Hey folks,
>>>>> 
>>>>> How do I set up a cron job to execute a script every
fifteen minutes
>>>>> of the day except for between the hours of midnight and
seven AM?
>>>>> 
>>>>> thx-
>>>>> 
>>>>> 
>>>> 15 7-23 * * * echo "run at 15 minutes past the hour,
8am-11pm"
>>> 
>>> Nay. That would go
>>> 0,15,30,45 7-23 * * *
>>> or shorter
>>> */15 7-23 * * *
>> 
>> Okay... some clarification please.
>> 
> man 5 crontab will clarify everything :)
> 
>> Which of those runs every fifteen minutes, but doesn't run at all
>> between midnight and seven AM?
>>
> The first one from  Douglas O'Neal will run every 15'th minute after the
> full hour (only once per hour).
> My two variants will do run every 15 minutes, and from 7-23. Uhm, maybe
> up to 23:45 ...
> 
>> I'm trying to set something up that should check status of a system
>> every fifteen minutes during business hours and send an alarm if
>> there's an issue. But, unlike me, the people that will respond to this
>> alarm aren't available 24/7.
>> 
> Ever thought about nagios?

I'm actually working on implementing Nagios.

This little project is a stop-gap measure to get people to stop yelling at
me. Though I'm not sure if Nagios can do what my script is doing. It uses
the mysql command line client to check if new records have been added to a
database in the last fifteen minutes. So it's not just checking for
connectivity or if the service is available it's also looking for the most
recent data in the database. Haven't got quite that far into Nagios yet.

-- 
I told you this was going to happen.
Post Reply
about | contact