CI/PHP/Unix newbie: How to schedule a cronjob in CI? |
[eluser]gstjohn[/eluser]
That should work. It's worth trying to see what happens if you put the URL in single quotes. Quote:wget 'http://www.mysite.com/index.php/cron/my_function'
[eluser]guy_in_cali[/eluser]
Wow, that was a quick reply. Yeah, I tried that too - using single quotes, but no luck. I don't get it..... Thanks for your help.
[eluser]gstjohn[/eluser]
As a test, try it with something you know should work like http://www.google.com.
[eluser]guy_in_cali[/eluser]
Hey thats a good idea. I tried Code: wget http://www.yahoo.com ![]()
[eluser]Phil Sturgeon[/eluser]
You can use my recent CLI modification to get it running. Post: CLI - CodeIgniter on the Command Line Quote:php /home/username/wherever/index.php cron my_function param1 param2 etc
[eluser]guy_in_cali[/eluser]
Hey everyone, thanks for all your help. My hosting company has given me to command to use on thier system, and it seems to be working. But I appreciate the help you guys have given me. ![]()
[eluser]Jonathon Hill[/eluser]
Using wget, curl, and lynx for a cronjob is an easy hack that often works, but what about security? If a spider or a web surfer somehow found the address of your cronjob controller, they could trigger it and potentially cause problems. I recommend doing it from the command line. You can try my cronjob bootstrapper. @pyromaniac I like your CLI mod too! But I think mine is easier to use ![]()
[eluser]nhm tanveer hossain khan (hasan)[/eluser]
[quote author="pyromaniac" date="1229440669"]You can use my recent CLI modification to get it running. Post: CLI - CodeIgniter on the Command Line Quote:php /home/username/wherever/index.php cron my_function param1 param2 etc[/quote] thanks you pointed this thing, last time we did this kinda job writing the following code - Code: <?php best wishes,
[eluser]guy_in_cali[/eluser]
Hey guys thanks for all your help. My hosting company has actually helped me out in this area. I've also tried to code in such a way so as to hopefully prevent unwanted calls to my script. |
Welcome Guest, Not a member yet? Register Sign In |