PDA

View Full Version : php cronjob failling...


fishsponge
27-06-2003, 10:22
i have set up the following cronjob...
1 * * * * cd /hsphere/local/home/fishspon/mongeese.co.uk/calendar/tools; ./send_reminders.php
but it's producing the following error when it runs:
/bin/sh: ./send_reminders.php: /usr/local/bin/php: bad interpreter: Permission denied
have i got the wrong path for the php executable? am i not allowed to execute
PHP as CGI like this?

Any ideas??

Karl
27-06-2003, 10:53
Hi,

Change it too:

1 * * * * /hsphere/local/home/fishspon/mongeese.co.uk/calendar/tools/send_reminders.php

Would also appreciate it if you changed it to not run every minute, but maybe every 5 if that's ok?

Thanks,

fishsponge
27-06-2003, 10:58
in the state that it's in, it runs at 1 minute past every hour... not every minute :D

ok, i've now changed it to:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /hsphere/local/home/fishspon/mongeese.co.uk/calendar/tools/send_reminders.php
i've also chmod'd the file to 755... :D

fishsponge
27-06-2003, 11:19
um... it doesn't seem to be running at all now.... i don't know why though.

i usually get the reports from the Cron Daemon every time a cronjob runs (i hate redirecting output to /dev/null), but i'm not getting them any more.

Also... the purpose this php script was designed for is not working either, so i'm tempted to believe that it's not running.

any ideas why??

Karl
27-06-2003, 12:15
*/5 * * * * /hsphere/local/home/fishspon/mongeese.co.uk/calendar/tools/send_reminders.php

Is much simpler :)

Can't see an obvious reason for it not running.

fishsponge
27-06-2003, 14:10
thanks... i've now changed it to:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * cd /hsphere/local/home/fishspon/mongeese.co.uk/calendar/tools; ./send_reminders.php ; mail -s crontab_test hobbs@mongeese.co.uk
...but it's simply not running the cronjob... this is strange. i know you suggested a couple of changes, but to be honest, it was running fine before, it was just erroring for a different reason.

as you can see, i've added a line to email me a blank email, so i know if it's actually running or not... maybe the Cron Daemon mailer has just died or something... i'll post an update in a few mins when i know if it's executing it or not :D

Karl
27-06-2003, 14:19
Well the problem at the moment (Only just noticed) is that the mail -s is going to sit there and wait for some input to actually send to the email address, so you'd need to try:

*/5 * * * * cd /hsphere/local/home/fishspon/mongeese.co.uk/calendar/tools; ./send_reminders.php ; echo "" | mail -s crontab_test hobbs@mongeese.co.uk

fishsponge
27-06-2003, 14:25
wrong... when "mail -s <subject> <emailaddress>" is run from something other than a terminal, it doesn't hang and wait for input, it just sends a blank email with the subject line filled in.

this is working fine now:
Date: Fri, 27 Jun 2003 13:20:00 GMT
From: Cron Daemon <root@storm.linux.uk.assimilatedservers.net>
To: hobbs@mongeese.co.uk
Subject: Cron <fishspon@storm> cd /hsphere/local/home/fishspon/mongeese.co.uk/calendar/tools; ./send_reminders.php ; mail -s crontab_test hobbs@mongeese.co.uk

Null message body; hope that's ok
...but the "send_reminders.php" script isn't actually sending the reminders. This is my own problem though.

What i think was happening was that the "send_reminders.php" script didn't output anything to standard-out, and the Cron Daemon therefore wasn't bothering to email me to say it had run... sound sensible??

what do you reckon??

now i just need to find out why the "send_reminders.php" script is failing... hmm...

fishsponge
27-06-2003, 15:19
right... i emailed the guy who develops this calendar system to ask why i wasn't receiving reminders (or any emails from the calendar for that matter), and he said (among other things):
Make sure you have a valid setting for "SMTP" in your php.ini file.
you couldn't check this for me could ya please karl?? i see no reason why it wouldn't be valid, but this is for the CGI build of PHP, not the Apache module build.

thanks again :D