I want to run PHPUnit on prod server every hour and write result to file. Here's the crontab line:
0 * * * * cd /path/to/project && /usr/local/bin/phpunit --exclude-group acceptance > phpunit.result
When I run that command manually phpunit.result
contains expected result, but when using crontab there's only the PHPUnit header in phpunit.result
:
PHPUnit 4.6.4 by Sebastian Bergmann and contributors.
Configuration read from /path/to/project/phpunit.xml
How can I achieve correct output PHPUnit result to file using crontab?
ps ax | grep php
? – hek2mglstrace -f
the cron process to see what happens whenphpunit
is started. – VolenDgrep CRON /var/log/syslog
) there's expected output.strace -f cron
isn't very helpful, here's the output – Limon Montecron
process and that would not work, ascron
is already running. Try to attach to the existing process -strace -fp cron_process_id
(I think I did not explain well in my previous comment and thought that-p
option is implied). – VolenD