cron

Joseph C. Lininger jbahm at pcdesk.net
Tue Jun 17 02:47:22 EDT 2003


Alex,
This is what I'm running as well. I'll give you a quick run down on how the crontab file works in this version of cron. You can also look this up in the manual by looking at the man page for crond. Don't look for crontab, as this will only give you the crontab program's page. There is no man page in section 5 for crontab for this version.

First, to edit crontab you will need to issue this command:

crontab -e

Make sure you set the VISUAL (notice that it's all caps) environment variable to the path to the text editor you want to use. This is the editor crontab will spawn.

The format of this file consists of several fields. basically, the line looks like this:

<minute> <hour> <day> <month> <days of the week> <command>

For any of these fields, you may use an absolute number, a list seperated by commas, or a * to indicate all values. Also, you can use a skip factor to have cron skip running the job at certin times. I'll show that in the examples below. For the <days of the week> field, you should use 0 for sunday through 6 for saturday. You'll want to direct the output of the command you run to /dev/null or some log file or you'll end up getting the results emailed to you.

Ok, now a couple of examples.

# run a command at 4:30 AM every day
30 4 * * * somecommand
# run a command at 2:30 in the afternoon on the first of the month
30 14 1 * * somecommand
# run a command at midnight every monday and tuesday
0 0 * * 1,2 somecommand
# illistrates the skip factor--run a command every 15 minutes
*/15 * * * * somecommand

Ok, if you have any more questions, let me know.
-- 
Joseph C. Lininger
jbahm at pcdesk.net

On Mon, 16 Jun 2003, Alex Snow wrote:

> slack 9.0
>
> --
> A message from the system administrator: "I've upped my priority, now up yours!"
> On Mon, 16 Jun 2003, Joseph C. Lininger wrote:
>
> > What distribution are you using? Syntax varies from version to version of cron.
> >
> > --
> > Joseph C. Lininger
> > jbahm at pcdesk.net
> >
> > On Sat, 14 Jun 2003, Alex Snow wrote:
> >
> > > Hi All.
> > > Does anyone know the syntax of the crontab file? I cant seem to find it.
> > > what I'm aiming to do is run a job every 15 mins or so but I cant seem to
> > > find the syntax and what all the fields are.
> > >
> > > --
> > > A message from the system administrator: "I've upped my priority, now up yours!"
> > >
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup at braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup at braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>




More information about the Speakup mailing list