CodeIgniter Forums
Cron not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Cron not working (/showthread.php?tid=44285)

Pages: 1 2


Cron not working - El Forum - 08-10-2011

[eluser]webnology[/eluser]
Hi all,

I have a script that needs to be run every 5 minutes. If I execute it via the url it works fine, but via cron it doesn't seem to work.

This is the cron
Code:
*/5 * * * * php -q /var/www/html/index.php customers sendBirthdays

Any ideas what else could go wrong?

All help appreciated,
Michel


Cron not working - El Forum - 08-10-2011

[eluser]danmontgomery[/eluser]
Code:
* * * * * /path/to/php /path/to/script

most likely /usr/bin/php, depending on your installation.


Cron not working - El Forum - 08-10-2011

[eluser]appleboy[/eluser]
Please use absolute PHP script path.

find php command:
Code:
# which php



Cron not working - El Forum - 08-10-2011

[eluser]appleboy[/eluser]
Please use absolute PHP script path.

find php command:
Code:
# which php



Cron not working - El Forum - 08-10-2011

[eluser]farhad zand[/eluser]
Code:
/usr/bin/curl -s http://yoursite.com/index.php/home/index



Cron not working - El Forum - 08-10-2011

[eluser]webnology[/eluser]
ok, it seems that he cron is executed every 5 minutes, as it should, but the mail is not being sent. If I execute it via the url, then my mail gets sent perfectly. Could it be that the cron job execution does not work properly with accessing a mailserver?

M


Cron not working - El Forum - 08-10-2011

[eluser]appleboy[/eluser]
you can try command first, it will display message?


Cron not working - El Forum - 08-10-2011

[eluser]farhad zand[/eluser]
no cron no limit for that you must maches your script With your caling address in cron job


Cron not working - El Forum - 08-11-2011

[eluser]webnology[/eluser]
I now have this in the cron:

*/5 * * * * /usr/bin/php -q /var/www/html/index.php customers sendBirthdays

It is executed every 5 minutes, but no mails arrive, which is what he qcript should do.

The script works, because if I enter it as a URL, mails arrive.

Please help...

M


Cron not working - El Forum - 08-11-2011

[eluser]appleboy[/eluser]
Please check /var/log/maillog first, and execute the command "/usr/bin/php -q /var/www/html/index.php customers sendBirthdays".

Dose it work on command, except no mails arrive?