[TriLUG] bash script execution time

Brian Henning lugmail at cheetah.dynip.com
Fri Jul 8 17:54:22 EDT 2005


Heck yeah dude.  cron allows you to specify ranges
I forget the order of the columns offhand, but it'd be something like
* * * 2-23 0,15,30,45 command
check the columns of course
and that would have it run three more times than you intend (2:00, 2:15, and
23:45) but it's darn close without having to check the time in your script.

~B

-----Original Message-----
From: trilug-bounces at trilug.org [mailto:trilug-bounces at trilug.org]On
Behalf Of Howard Boyd II
Sent: Friday, July 08, 2005 5:42 PM
To: trilug at trilug.org
Subject: [TriLUG] bash script execution time


Now that I have a working script (thanks again for all the help!). I
have a question about scheduling it to run. I want the script to execute
every 15 minutes throughout the day except between the hours of 23:30
and 02:30. My thinking is to schedule the script to run every 15 minutes
via cron and then build some logic into the script that says if it is
between the hours of 23:30 and 02:30, don't execute the heart of the
script.

Can someone provide the logic/conditional statement for a bash script
to check the time to see if it is between 23:30 and 02:30?

Is there some way of using cron alone to accomplish what I'm attempting
to do?

Regards,

Howard


***********************************
*    In my dreams, your dreams come true.
*    Song: In My Dreams
*    Artist: Josh Turner
*    CD: Long Black Train
***********************************



--
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc




More information about the TriLUG mailing list