Welcome Guest, Not a member yet? Register   Sign In
CI/PHP/Unix newbie: How to schedule a cronjob in CI?
#11

[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'
#12

[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.
#13

[eluser]gstjohn[/eluser]
As a test, try it with something you know should work like http://www.google.com.
#14

[eluser]guy_in_cali[/eluser]
Hey thats a good idea. I tried
Code:
wget http://www.yahoo.com
and it gives me the same error. I'm going to open a ticket with my hosting company, see what they think is going on. Thanks again dude. Smile
#15

[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
#16

[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. Smile Hope you're having a great week.
#17

[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 Wink
#18

[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
  $_GET["/url/which/was/mapped/in/routing/table"] = "";
  require 'index.php';
?>
and added php script.php in crontab.

best wishes,
#19

[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.




Theme © iAndrew 2016 - Forum software by © MyBB