Welcome Guest, Not a member yet? Register   Sign In
RESTful Cron
#1

[eluser]CI Lee[/eluser]
Hello All,

Have any of you worked with Cron and CI before? I have a question regarding how one would have the cron hit a file in CI.
Code:
/cron/parse/password
How would I specify the functions that need to be passed to the file?

Can anyone post their cron to line here to show an example?

Thanks

-Lee
#2

[eluser]Michael Wales[/eluser]
Review this wiki page, which allows you to utilize CodeIgniter without using the HTTP connection:
http://codeigniter.com/wiki/Category:Adv...ronScript/

You would then just call a Class->method($params) via the URL as normal. This cron line would call the URL at hour 13 (1:00PM) every day.
Code:
0 13 * * * wget http://yourdomain.com/cron/parse/password

To run an hourly cron, select a minute value (this example uses 30, and would run at the bottom of every hour):
Code:
0 * * * * wget http://yourdomain.com/cron/parse/password
#3

[eluser]CI Lee[/eluser]
Yes I had looked at that however wget fetches that page to your server which is not a big deal but...

I was looking for a way to either send it to dev>null or maybe an external service.
#4

[eluser]Michael Wales[/eluser]
Code:
0 * * * * wget -O /dev/null http://yourdomain.com/cron/parse/password 2> /dev/null
#5

[eluser]lifewithryan[/eluser]
I believe that there is also
Code:
wget --delete-after
as well...




Theme © iAndrew 2016 - Forum software by © MyBB