CodeIgniter Forums
CRON runs but doesn't get passed parameters - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: CRON runs but doesn't get passed parameters (/showthread.php?tid=58926)



CRON runs but doesn't get passed parameters - El Forum - 08-05-2013

[eluser]monoclonal[/eluser]
Hi all,

I am trying to setup a CRON in cpanel. I have it 'working' in that the CRON runs but instead of getting my actual cron controller called I only get the index.php / default controller called.
I can run the cron file using the url eg;
Quote:www.site.com/cron_controller/cron_function
But when I run the cron in cpanel I only get the output of the default controller. Here is my cron job:
Quote:/usr/bin/php /home/user_directory/public_html/index.php cron_controller cron_function

Any thoughts?


CRON runs but doesn't get passed parameters - El Forum - 08-06-2013

[eluser]ortwin.van.vessem[/eluser]
Have a look at the following blog post: http://stevethomas.com.au/php/how-to-run-cron-jobs-in-codeigniter.html


CRON runs but doesn't get passed parameters - El Forum - 08-06-2013

[eluser]monoclonal[/eluser]
Thanks, but I can get php scripts to run, it's just the mapping of the controller/ method that isn't working. I am also posting this on whirlpool:

http://forums.whirlpool.net.au/forum-replies.cfm?t=2138669


CRON runs but doesn't get passed parameters - El Forum - 08-09-2013

[eluser]LifeSteala[/eluser]
Hello,

Please see my post reply here as I believe it will answer your question.

Cron Jobs command with parameters

Hope that helps.
LS


CRON runs but doesn't get passed parameters - El Forum - 08-10-2013

[eluser]ivantcholakov[/eluser]
@monoclonal

I use the Hack 4 "Running CodeIgniter from the Command Line", described here: http://net.tutsplus.com/tutorials/php/6-codeigniter-hacks-for-the-masters/

I have not tested this hack with cpanel, but it is worth for you to try it.


CRON runs but doesn't get passed parameters - El Forum - 08-13-2013

[eluser]monoclonal[/eluser]
[quote author="LifeSteala" date="1376112549"]Hello,

Please see my post reply here as I believe it will answer your question.

Cron Jobs command with parameters

Hope that helps.
LS[/quote]

This is exactly what I was looking for! Problem SOLVED!

Thank you kind Steala