简体   繁体   中英

Cron job for PHP yiic command

I have created a php yiic command as

class StartCommand extends CConsoleCommand {

  public function run($params){
    Yii::log("Cron Job has started");        
  }
}

When I run the command php yiic Start , I get the result in the log.

And I have add this to the crontab

 * * * * * /usr/bin/php  /path/app/console/commands/StartCommand.php

But the job is not running. I think I have to mention the php yiic Start to the crontab.

But where do I add it ??

* * * * * cd /path/app/console/commands && php yiic Start

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM