Yii and cron works

I created a Yii team that needs to be run every month. If I go to the protected folder and run the command manually:

protected/yiic ganadores

It works great. I tried to add the following command in etc/cron.hourlyand etc/crontabwithout success:

/usr/bin/php5 /var/www/path/to/project/protected/yiic ganadores (etc / cron.hourly / ganadores)

0 0 1 * * root /usr/bin/php5 /var/www/path/to/project/protected/yiic ganadores  (Etc. / crontab)

If I run the file ganadoresinside etc/cron.hourlymanually, it also works.

What am I missing here?

Edit: Finally, it was resolved. I had extra seats in the cron line. A tab is used instead of spaces, and it started working.

+3
source share
1 answer

Here's how I run the Yii cron jobs (in the crontab root file):

45 23 * * * sudo -u www-data php /path/to/yii/app/protected/console.php mycommand

crontab, console.php yiic, Apache (www-data), script. , , , , , .:)

+6

All Articles