Reboot crontab not working on reboot

Tag: crontab Author: liuqi236894175 Date: 2013-03-26

This is the crontab: @reboot cd /var/test/ && php gearman_test.php

but whenever I ssh and run ps -aux | grep .php I cannot see gearman_test.php

If I copy paste the command (without the @reboot) it works from any directory.

if I now run ps -aux | grep .php I see gearman_test.php

the syslog is showing: Apr 11 17:11:48 server CRON[2441]: (root) CMD (cd /var/test/ && php gearman_test.php)

I also tried adding an & at the end but it didn't work.

Instead of php, use /bin/php or whatever comes from which php. Also, it is better to execute with full path: /bin/php /var/test/gearman_test.php
execution with full path would not work because of the requires() inside the gearman_test.php file
and it still didn't work