I have written a ConsoleCommand which runs awesome from Windows Command prompt and also linux terminal. My problem is that , when I add this command in the cron tab I get the following error when it is been executed.
This script must be run from the command line.
What could be the problem ?
PS: When I had register_argc_argv Off in my php.ini, I was not even able to run this command from terminal. When I turned it on, It started working from terminal but it is not at all working when I have it in crontab!
I always wonder, why so many people use custom console.php or similar things when this is absolutely not neccessary. I mean, the steps to create a custom console command are really simple and described well in the documentation:
Create a class that extends from CConsoleCommand and put it into your protected/commands folder
Call the command from yiic in your protected directory: /path/to/my/project/protected/yiic myCommand