Web Hosting Talk







View Full Version : Cron Job Question...


MegaHosters
06-24-2005, 03:53 AM
Hi everyone... I just installed a script for a customer and I can not get the cron job to run. I know cron on the server is working just fine so it is not a problem with cron.

I think it is a problem with the commands I am using. Below are two pairs of commands I have in crontab but for some reason it is not running the two scripts at the specified times... in fact it is not running them at all.

Can anyone suggest why?

---------- METHOD 1 THAT I TRIED ------------

@hourly GET http://www.XXXX.com/cgi-bin/arp3/arp3-auto.pl

@daily GET http://www.XXXX.com/cgi-bin/arp3/arp3-report.pl

---------- METHOD 2 THAT I TRIED ------------

@hourly /home/www/www.XXXX.com/cgi-bin/arp3/arp3-auto.pl > /dev/null 2>&1

@daily /home/www/www.XXXX.com/cgi-bin/arp3/arp3-report.pl > /dev/null 2>&1

---------------------------

Neither of the above worked....

Suggestions?

Thanks in advance,

C

Slidey
06-24-2005, 07:19 AM
hi,

try

10 * * * * /hourlyscript
10 10 * * * /dailyscript

if you can run the script from teh cmdline, then you'll be able to add it to cron

fastduke
06-24-2005, 11:21 AM
First, does the script run by itself? (without using cron to execute it)

---------- METHOD 1 THAT I TRIED ------------

@hourly GET http://www.XXXX.com/cgi-bin/arp3/arp3-auto.pl

@daily GET http://www.XXXX.com/cgi-bin/arp3/arp3-report.pl

---------- METHOD 2 THAT I TRIED ------------

@hourly /home/www/www.XXXX.com/cgi-bin/arp3/arp3-auto.pl > /dev/null 2>&1

@daily /home/www/www.XXXX.com/cgi-bin/arp3/arp3-report.pl > /dev/null 2>&1

---------------------------

MegaHosters
06-24-2005, 11:28 AM
Yes it does... If I trigger the script it works fine.

Even when I use Webmin on the server and select the cron job and say RUN NOW it WILL run the job.

Still not understanding why it won't work.

C

fastduke
06-24-2005, 11:47 AM
so what does "crontab -l" output?

WLHosting
06-24-2005, 07:11 PM
What about using the time and then the full path not using http in the path?

Something like /home/user/public_html/cgi-bin/arp3/arp3-auto.pl ?

MegaHosters
06-24-2005, 07:31 PM
Originally posted by WLHosting
What about using the time and then the full path not using http in the path?

Something like /home/user/public_html/cgi-bin/arp3/arp3-auto.pl ?

ok.. Go back up... Look at the 2nd method I tried. ;)

C

digibiz
06-25-2005, 08:10 PM
0 * * * * /home/xxxx/.XXXX.com/cgi-bin/arp3/arp3-auto.pl > /dev/null

Is the correct format for the hourly CRON. Assuming you are using Cpanel to input the job. Not sure about other control panel formats.

0 0 * * * /home/xxxx/xxxx.XXXX.com/cgi-bin/arp3/arp3-auto.pl > /dev/null

Is correct for the daily job.

Hope this helps

Jeff

MegaHosters
06-25-2005, 10:55 PM
Thanks Jeff, I'll give that a shot.

We are not using cpanel on that server but it does not matter anyway as a cronjob is a cronjob. For this particular dedicated server we just enter it in to the crontab file directly.

crontab -e

I'll give it a go and report back when I get time.

Thanks,

C