Welcome Guest, Not a member yet? Register   Sign In
Crons and schedualed tasks
#1

[eluser]Ahmed Nuaman[/eluser]
Hello everyone,

Just wondering if anyone's got a workaround for this problem:

With most php code, you just visit www.website.com/thispage.php?thisis=avar

However, with CI, it's obv www.website.com/index.php/thispage/thisis/avar

I'm not complaining, it's lovely. Just one thing: how can I set up scheduled tasks to run C:/Folder/site/index.php/thispage/thisis/avar? (Normally, you'd run C:/Folder/site/thispage.php?thisis=avar)

Any ideas?
#2

[eluser]Matthew Lanham[/eluser]
I had a problem similar to this with a support system we use....what i did was create a PHP page that used file_get_contents() to fire the page up, then linked to it in in a CRON in the normal way so for you make a page:

file_get_contents("www.website.com/index.php/thispage/thisis/avar");

in a file called say fire.php

then in your cron just call to the fire.php page....

This worked for me...
#3

[eluser]nmweb[/eluser]
wget does the job quite well. There should be another thread somewhere that also covers this.
#4

[eluser]Ahmed Nuaman[/eluser]
Yeah I thought of doing that, but (due to increase in security) I can’t do that on my system. The script I’m wanting to run can only every run at the start of every month. I don’t want bob to be able to access it. Therefore I’ve limited it to only accept post vars and I’ve limited my system to only accept post vars from the same domain.

I may just have to rewrite the script as a file!
#5

[eluser]Sean Murphy[/eluser]
I've set up cronjobs before with the suggestions from this wiki page: http://codeigniter.com/wiki/Category:Adv...ronScript/
#6

[eluser]Chris J Smith[/eluser]
I tend to write cron jobs in python. There is a high risk of script execution timeouts and other ill effects in PHP due to hosting company configuration settings.
#7

[eluser]Ahmed Nuaman[/eluser]
I'm on a dedicated server so I've got full control. It's windows based, which, I never thought I'd say this, is easier to managed and use than any Linux boxed I've used! Nevertheless, I'd like to keep it in PHP for consistency.
#8

[eluser]Ahmed Nuaman[/eluser]
[quote author="Sean Murphy" date="1203477895"]I've set up cronjobs before with the suggestions from this wiki page: http://codeigniter.com/wiki/Category:Adv...ronScript/[/quote]

That's frickin' awesome! Thanks for the tip!




Theme © iAndrew 2016 - Forum software by © MyBB