Koozali.org: home of the SME Server

Creating CRON Jobs

Robert Heaton

Creating CRON Jobs
« 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.

Urirama

Re: Creating CRON Jobs
« Reply #1 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

Filippo Carletti

Re: Creating CRON Jobs
« Reply #2 on: April 29, 2002, 06:44:13 PM »
> */4 * * * * /full/path/to/your/job

*/4 means every four minutes.
*/15 is every 15.

Urirama

Re: Creating CRON Jobs
« Reply #3 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.

Robert Heaton

Re: Creating CRON Jobs
« Reply #4 on: April 29, 2002, 08:14:49 PM »
Thanks guys, that works perfectly!

Kind regards,
Rob.

Serge Dutremble

Re: Creating CRON Jobs
« Reply #5 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

Urirama

Re: Creating CRON Jobs
« Reply #6 on: May 02, 2002, 06:44:50 PM »
Which cron job is sending the mails?

Filippo Carletti

Re: Creating CRON Jobs
« Reply #7 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.