crontab not working

crontab not working

Posted by: ne0nguy
Posted on: 2006-03-14 13:25:00

I need to have a file called hlstats.pl running in the background for may server stats page
http://www.ne0nguy.com/hlstats/hlstats.php

I figured I would use crontab to keep it running every hour
My crontab file looks like this:
0 * * * * "perl hlstats/perl/hlstats.pl"

while in the Shell when I type "perl hlstats/perl/hlstats.pl" it works but the crontab never runs

can someone give me some tips on how to fix it?

Re: crontab not working

Posted by: norm1037
Posted on: 2006-03-14 13:48:00

Have you tried the crontab using the full path starting from /home/username/ne0nguy.com/hlstats/hlstats.ph and the .ph is executable.

i.e. 0 * * * * perl "/home/username/ne0nguy.com/hlstats/hlstats.ph"

Re: crontab not working

Posted by: ne0nguy
Posted on: 2006-03-14 13:54:00

ok ill try it
do you think it will work if i dont have a .ph file in that directory?

Re: crontab not working

Posted by: norm1037
Posted on: 2006-03-14 13:57:00

No it is okay to have the .ph file where you want it.

I probably missed your 'perl' folder out by mistake so add that in and give the full path to the .ph file.


Fixed

Posted by: ne0nguy
Posted on: 2006-03-14 14:08:00

Ok thanks man it turns out i just needed to have perl outside of the quotes

just for reference:
do you know how to stop a service that crontab is running?Edited by ne0nguy on 03/14/06 02:31 PM (server time).

Re: Fixed

Posted by: norm1037
Posted on: 2006-03-14 14:58:00

Do you mean to delete the crontab using crontab -e?
Just edit it out and save the crontab.

Or do you mean using ps aux and then using kill to kill your process?

Re: Fixed

Posted by: ardco
Posted on: 2006-03-14 16:57:00

> do you know how to stop a service that crontab is running?

From man crontab:

The -r option causes the current crontab to be removed.

So, crontab -r ?

Good luck,

BobS

Tags: hlstatscrontabperlhttprunningshellbackgroundphp