Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Joe Bob on November 13, 2003, 01:42:34 AM

Title: Crontab not running. What am I doing wrong?!
Post by: Joe Bob on November 13, 2003, 01:42:34 AM
Ack!    I have banged my head on the wall for hours now.

To test to make sure it will work, I created a cron job by doing this:

crontab -e

i
10 * * * * wget http://weather.unisys.com/satellite/sat_ir_west.gif -O /home/e-smith/files/primary/html/contest/test.gif

:wq

As I understand it, that should get the image every 10 min and stick in in the directory listed.  

If I enter this on the command line, it does work:
wget http://weather.unisys.com/satellite/sat_ir_west.gif -O /home/e-smith/files/primary/html/contest/test.gif

I have some other useful cronjobs to set up, but for the life of me cannot seem to get even a simple one to run.

Any help is VERY appreciated.

Thanks.
Title: Re: Crontab not running. What am I doing wrong?!
Post by: Michiel on November 13, 2003, 01:49:18 AM
Probably crontab can't find wget. Try /usr/bin/wget.
Title: Re: Crontab not running. What am I doing wrong?!
Post by: Joe Bob on November 13, 2003, 03:56:34 AM
Tried that.  Still no go.

Other suggestions?  

I am dying here trying to figure this out.

Crontab from HELL!
Title: Re: Crontab not running. What am I doing wrong?!
Post by: Joe Bob on November 13, 2003, 04:40:35 AM
Follow up:

Problem solved.

I realized that
5 * * * *  command
means that it will run at 5 after the hour, not every 5 min!  Doh!

Got it working now.

One more question:
Any way to turn off the emails the Cron Daemon sends me every time a cron job runs?  

Thanks again for all the help fellow SME Server users!
Title: Re: Crontab not running. What am I doing wrong?!
Post by: Neal Collins on November 13, 2003, 07:57:57 AM
Joe Bob wrote:
>
> Follow up:
>
> Problem solved.
>
> I realized that
> 5 * * * *  command
> means that it will run at 5 after the hour, not every 5 min!
> Doh!
>
> Got it working now.
>

Well I missed that one, and I should have known better!

> One more question:
> Any way to turn off the emails the Cron Daemon sends me every
> time a cron job runs?
>

Redirect the output to /dev/null like so:

5 * * * *  command  > /dev/null (if you still want to see error messages)

or

5 * * * *  command > /dev/null 2>&1 (if you don't want to see any messages at all)

--
Neal
Title: Re: Crontab not running. What am I doing wrong?!
Post by: Joe Bob on November 13, 2003, 11:42:01 PM
Very cool.

Thanks for all the help.   I am on to cron goodness now....