Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Robert Heaton on April 29, 2002, 02:58:12 PM

Title: Creating CRON Jobs
Post by: Robert Heaton on April 29, 2002, 02:58:12 PM
HI,

Can someone tell me how to create a CRON job, that will run every 15 minutes.


Thanks in advance,
Rob.
Title: Re: Creating CRON Jobs
Post by: Urirama on April 29, 2002, 03:20:26 PM
Log into the server as root. Type in:  

crontab -e
i
*/4 * * * * /full/path/to/your/job

:wq
Title: Re: Creating CRON Jobs
Post by: Filippo Carletti on April 29, 2002, 06:44:13 PM
> */4 * * * * /full/path/to/your/job

*/4 means every four minutes.
*/15 is every 15.
Title: Re: Creating CRON Jobs
Post by: Urirama on April 29, 2002, 06:57:53 PM
Oops, sorry.  I assumed it meant "divide every hour by four" but as I never actually used this particular type of timing on my cron jobs I never found out it's wrong.  Thanks for correcting.
Title: Re: Creating CRON Jobs
Post by: Robert Heaton on April 29, 2002, 08:14:49 PM
Thanks guys, that works perfectly!

Kind regards,
Rob.
Title: Re: Creating CRON Jobs
Post by: Serge Dutremble on May 02, 2002, 06:38:48 PM
How do you stop the email message sent to admin each time this job runs?

I tried doing this in the past but realised after a few months that I had litterally THOUSANDS of messages in my admin mailbox.

Yes, you guessed it, I don't check the admin mailbox often!

Thanks for any help.

Serge
Title: Re: Creating CRON Jobs
Post by: Urirama on May 02, 2002, 06:44:50 PM
Which cron job is sending the mails?
Title: Re: Creating CRON Jobs
Post by: Filippo Carletti on May 02, 2002, 08:09:57 PM
Add "&>/dev/nll" after the command. Not a good idea.
Better to have the jobs modified to output something only in case of error.