Forum Moderators: phranque

Message Too Old, No Replies

Cron Job not running!

         

anand84

3:05 pm on May 7, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all

I recently moved host because my PHP script that I ran on CRON was supposedly taking too much load on the server.

But I now have a new problem at hand. The CRON job at the new host is not updating. The script which was set to run every hour is not running. I had set the CRON to email me the output each time it runs (i.e. one mail every hour). I do get the email, but the email reads 'Permission Denied', which is possibly the reason for the script not running.

There is nothing wrong with the PHP script, as I have now been manually running it every hour. So, the problem is with the CRON. My host is also unsure of what the problem is. Can someone advice? Thanks.

phranque

8:41 pm on May 7, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the cron job has the privileges of the user who scheduled the job.
the error means either the script has insufficient permissions to be executed by the cron job or the user who scheduled the cron job does not have sufficient ownership of the script to execute it.

anand84

6:11 pm on May 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



aah! How did I not think of that..Thanks a lot Phranque...

anand84

2:23 pm on May 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Phranque

Sorry for replying so late, but the CRON still seems to have some problem. I now get the following message:

/home/ACCOUNTNAME/public_html/FOLDER/cron_update.php: line 1:?php
: No such file or directory
/home/ACCOUNTNAME/public_html/FOLDER/cron_update.php: line 2: syntax error near unexpected token `'includes/application_top.php''
/home/ACCOUNTNAME/public_html/FOLDER/cron_update.php: line 2: ` require('includes/application_top.php');
'

What do you think is the mistake here?
Thanks

anand84

2:26 pm on May 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This apart, as I had already mentioned, I run the PHP link every now and then to cover up the CRON's malfunction. My host suggested this:

usr/bin/GET http://www.example.com/cron_update.php

But, I get this error message..

/bin/sh: usr/bin/GET: No such file or directory

Any inputs on what is going wrong in this one?

phranque

5:13 am on May 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Sorry for replying so late, but the CRON still seems to have some problem. I now get the following message:

/home/ACCOUNTNAME/public_html/FOLDER/cron_update.php: line 1:?php
: No such file or directory
/home/ACCOUNTNAME/public_html/FOLDER/cron_update.php: line 2: syntax error near unexpected token `'includes/application_top.php''
/home/ACCOUNTNAME/public_html/FOLDER/cron_update.php: line 2: ` require('includes/application_top.php');
'

What do you think is the mistake here?

it might help to see the php source.
i'm not sure what the "line 1" error is.
regarding the 2 "line 2" errors, i would guess that you need to specify a complete path to the file instead of using a relative filepath.
of course i have no practical knowledge of php syntax, so it may actually be a syntax error in the "require" statement.

perhaps someone who knows php will weigh in or you could repost in that forum.

phranque

5:41 am on May 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



This apart, as I had already mentioned, I run the PHP link every now and then to cover up the CRON's malfunction. My host suggested this:

usr/bin/GET http://www.example.com/cron_update.php

But, I get this error message..

/bin/sh: usr/bin/GET: No such file or directory

Any inputs on what is going wrong in this one?

you probably don't have the GET command installed or it is the wrong path for that command.
you could try "whereis GET" to see if it can be found elsewhere.
you could also try the lwp-request command or the wget command instead of GET.
or you could just use your favorite web browser to "GET" the script.

anand84

5:12 pm on May 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the other commands Phranque..But they still do not seem to be working. I guess I will have to install them.

As I browsed through my file manager, I observed that there is nothing called a /usr/bin folder in the first place.