[NTLUG:Discuss] Simple: cron (file) format to schedule a task to run at any time.

MadHat madhat at unspecific.com
Fri May 26 08:37:10 CDT 2000


Christopher Browne wrote:
> 
> On Thu, 25 May 2000 15:55:45 PDT, the world broke into rejoicing as
> hector M Banda <hector at need-info.com>  said:
> > Hi all,
> > I'd like to know the format for the crontab file to schedule a task to run at
> > any interval of time or days.
> >
> > I'm familiar with the one comes with SCO UNIX but I'm not sure about LINUX
> > (RH6.0)?
> 
> I suggest you consult the manual page:
> % man 5 crontab
> 
> Reformatting crontab(5), please wait...
> 
> CRONTAB(5)                                             CRONTAB(5)

That was annoying...


5 fields, * means every time, like every minute, or every day...

format
-------------------------------------
*  *  *  *  *  /path/to/cmd
-------------------------------------

fields         values
------         ------
minute         0-59
hour           0-23
day of month   1-31
month          1-12
day of week    0-7

then if you want to do every 5 min you could say

*/5 * * * * /path/to/cmd


and please people, don't post the entire man page, all distributions
come with the man pages and it is rather annoying because the formatting
doesn't transfer well...

-- 
MadHat at unspecific.com
                                   "The 3 great virtues of a programmer:
                                      Laziness, Impatience, and Hubris."
                                                 --Larry Wall




More information about the Discuss mailing list