Unix questions - Cron Job - Scheduling Query

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > December 2005 > Cron Job - Scheduling Query





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Cron Job - Scheduling Query
raghu

2005-12-29, 6:05 pm

Hi,

I need to schedule a cron job (AIX) which runs every 10 minutes (like
9:10, 9:20, 9:30, etc) except at midnight. What would be the syntax for
this?

Thanks.

Bit Twister

2005-12-29, 8:52 pm

On 29 Dec 2005 15:46:44 -0800, raghu wrote:
> Hi,
>
> I need to schedule a cron job (AIX) which runs every 10 minutes (like
> 9:10, 9:20, 9:30, etc) except at midnight. What would be the syntax for
> this?


What does a
man 5 crontab

show?
Barry Margolin

2005-12-29, 8:52 pm

In article <1135900004.213995.277820@g49g2000cwa.googlegroups.com>,
"raghu" <raghu_vnin@yahoo.com> wrote:

> Hi,
>
> I need to schedule a cron job (AIX) which runs every 10 minutes (like
> 9:10, 9:20, 9:30, etc) except at midnight. What would be the syntax for
> this?


The standard syntax is:

0,10,20,30,40,50 1-23 * * * <command line>
10,20,30,40,50 0 * * * <command line>

It's necessary to split it into two lines to avoid midnight; another way
to do that would be to have the command check whether it's midnight when
it starts, and just exit. Then you can combine the lines into one:

0,10,20,30,40,50 * * * * <command line>

With many recent versions of cron you can replace the list of minutes on
the first line with */10, which means every 10 minutes. Check your man
page to see whether your version supports this.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com