user385729
user385729

Reputation: 1984

Scheduling a controller method by Windows task scheduller

I'm following this tutorial (http://amitdhamu.com/blog/automating-php-using-task-scheduler/) to schedule a task in PHP Codeignitre, however in step 1 of the mentioned tutorial I dont know how I can pass the controller method instead of a whole php file?! Could you please help me in this regard?

Also I need to provide the option of scheduling for the admin of my web application as well in a way that they can change the scheduleer; is there any way that I can pass the task manager options with PHP?

Please if my question is not clear, please let me know which part you need more clarification

PS: I have a windows server!

Thanks

Upvotes: 1

Views: 1732

Answers (1)

Joao Polo
Joao Polo

Reputation: 2163

If you want to execute CodeIgniter code from schedule, replace the call, in .bat:

from:

php C:\Apache\htdocs\automatic.php

to:

php C:\Apache\htdocs\index.php myController <myMethod> <arg1> <arg2>

sample:

php C:\Apache\htdocs\index.php users update

Upvotes: 1

Related Questions