dariusphp
dariusphp

Reputation: 93

Symfony2 Command not working with cron

the command works when its manually called, but does not when its on cron. I have used Cron Job in symfony2 this for referencing. did not work.

command in cron is:

55 09 * * * /usr/bin/php /var/www/symfony2/current/app/console mycommand >> /var/www/symfony2/logs/logthis.txt

the /current/ is a link from capistrano to the current version.

EDIT: I would like to add to peter_the_oak list. A obvious one but still.

if its not working

Upvotes: 0

Views: 2053

Answers (1)

peter_the_oak
peter_the_oak

Reputation: 3710

Sometimes if cron jobs are not working, it's because one of these points:

  • Make sure the file permissions and the user are matching. https://askubuntu.com/questions/189189/how-to-run-crontab-as-userwww-data I know you'll say "it's just root", but as we don't see everything here, maybe there's some mistake.
  • Make sure you edit the tab the right way (crontab command)
  • Make sure the time definition are what you really mean. Your script will be run at 9:55 am, and what is the current time of your server?

So I suggest first write a definition with only stars to have every minute a call, and first call just some echo to observe. Then alter the echo to your real PHP command and observe again. After that, set the time parameter and check the server time. That should do it.

Upvotes: 1

Related Questions