Does anyone know an elegant way to run yii commands periodically? I need to run a yii command or "script" say every minute to monitor files in a folder, and add their contents to a database used by the yii webapplication. This communication is enforced by a legacy system I cannot change.
I’m using yii on a Windows platform.
Thanks for any valuable comments.
I think you can do it via windows "scheduled task".
Ok, thanks. Now I just need to figure out how to create command without using the shell. I guess that is possible though I have never done that before.
This is how I execute console commands in linux crontab, Sameway you can use it on windows as well.
Make a copy of <your app>/index.php and rename it as what ever name. in mine I named as console.php
now you can run your command in command prompt as
first cd to your php.exe folder if run on windows otherwise no need
then php /path/to/console.php <your command>
In windows scheduler or linux crontab just add
php /path/to/console.php <your command>