I have set up a cron task using the cron jobs application in CPanel, i indicated that every six hours it should run the following task http://www.mysite.com/cron.php and i took it for granted that it is working, but i was dissapointed when i checked the emails giving me this message /bin/sh: www.pslegion.com/cron.php: No such file or directory, i tried to play with the address, i used http://www.mysite.com/cron.php then mysite.com/cron.php then /cron.php... in short a lot, but that didn't make it work... anyway i should point out to the fact that i can run the cron manually, i can verify that by the logs entries, also there is no signs of failed attempts on the logs....
so what's the issue here?
thanks in advance for any help

Comments

masande’s picture

you need to point your cron job to 'cron-curl.sh' which is in the 'scripts' directory (make sure you use the full system path). in that file swap out 'example.com' with your domain. for most of my sites this works every time.

Mark Sanders
Q Collective

Mark Sanders
Q Collective

pnlnl’s picture

/bin/sh: http://www.mysite-which-is-my-site-:).com/scripts/cron-curl.sh: No such file or directory

so anymore ideas???

masande’s picture

please confirm: are you using the full system path to the script when you set up the cron job? it should look something like the following...

/home/username/public_html/scripts/cron-curl.sh

and not...

http://example.com/scripts/cron-curl.sh

your cpanel homepage will tell you the path to the root directory.

Mark Sanders
Q Collective

Mark Sanders
Q Collective

pnlnl’s picture

i am not using this 'verbose' version and didn't try it,, but will do now...

pnlnl’s picture

I am making progress now, after using the verbose version, i got a message
/home/mysite/public_html/scripts/cron-curl.sh: access denied
so i changed the permissions to 744, then i got this message
/home/mysite/public_html/scripts/cron-curl.sh: line 4: curl: command not found
can anyone help me further down the road here?

masande’s picture

cron-curl.sh is a shell script that depends on your webhost having curl installed on their server. since the server is returning curl not found, i have to assume curl is not installed.

there is this handbook page that gives an alternate method for running cron but i'm afraid it is over my head a bit. as a refresher, however, you may want to look at all the cron tips in the handbook starting here. there are some webhost specific instructions if you have dreamhost or mediatemple.

Mark Sanders
Q Collective

Mark Sanders
Q Collective

pnlnl’s picture

thanks masande for your help...
now let me ask one more question, i opened the cron curl file and found this

#!/bin/sh
# $Id: cron-curl.sh,v 1.3 2006/08/22 07:38:24 dries Exp $

curl --silent --compressed http://example.com/cron.php

now should I change http://example.com into smth like the verbose version you gave me earlier???

masande’s picture

you do need to change the url in that file to point to cron.php but do not use the verbose path you used earlier. as recommended in the file, change http://example.com/cron.php to the url you use to manually fire the cron job.

does this work?

Mark Sanders
Q Collective

Mark Sanders
Q Collective

pnlnl’s picture

that's not working, i have already tried this...

edit: I'll try handbook page you gave me later and post if it worked for me or not... but if there is any other way to get this working, anybody is welcome to utter it.....

pnlnl’s picture

so i am back, now i am trying to use the code provided by the handbook page...

and i need help of how to specify the root path which is by default
root_path=/var/www/html/
and in the file manger i can see
/home/mysitename
so how should i input the the path?

EDIT: I HAVE MOVED THE DISCUSSION TO another post as the main issue of this one has been solved and now i am facing another dilemma