Welcome Guest, Not a member yet? Register   Sign In
Cron Job and CodeIgniter
#1

[eluser]Sinclair[/eluser]
Hi,

I'am trying to put some Cron Jobs to work... I have used this method, http://phpstarter.net/2008/12/run-codeig...-line-ssh/

When I run a command like this from the command line, everything works great

Quote:php /home/mywebhostaccount/public_html/cli.php cron send_mail

In the Cron Job I'am using the same command...

Quote:*/15 * * * * php /home/mywebhostaccount/public_html/cli.php cron send_mail

I should modify something in this Cron Job Line?

Best Regards,
#2

[eluser]Georgi Budinov[/eluser]
On some environments in order to get the cron job working ok you need to specify the full path to the php binary e.g. /usr/bin/php depending on the system itself
#3

[eluser]Clooner[/eluser]
It looks alright... Give it a try!
#4

[eluser]Sinclair[/eluser]
It is not running the Cron Job.

There is a way to see the logs generated by the Crontab? I'am in a shared environment.

Best Regards.
#5

[eluser]Clooner[/eluser]
[quote author="Sinclair" date="1281720390"]It is not running the Cron Job.

There is a way to see the logs generated by the Crontab? I'am in a shared environment.

Best Regards.[/quote]

By default the output from cron gets mailed to the owner of the process.

You can always pipe the output to some log file if you need to!

It's easy, Google is your friend!
#6

[eluser]Sinclair[/eluser]
Should this do the work?

Quote:*/15 * * * * /usr/bin/php /home/mywebaccount/public_html/cli.php cron send_mail >> /home/mywebaccount/logcron

Best Regards,
#7

[eluser]Clooner[/eluser]
[quote author="Sinclair" date="1281720946"]Should this do the work?

Quote:*/15 * * * * /usr/bin/php /home/mywebaccount/public_html/cli.php cron send_mail >> /home/mywebaccount/logcron

Best Regards,[/quote]

Again by default the output of the cronjob gets mailed to the owner of the process!

Code:
*/15 * * * * /usr/bin/php /home/mywebaccount/public_html/cli.php >> /home/account/logfile.txt
to output the cronjob to a logfile.

Just checking, are you allowed to run cron jobs on your account? A lot of hosts disable this functionality.




Theme © iAndrew 2016 - Forum software by © MyBB