Reputation: 54409
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?
Upvotes: 0
Views: 670
Reputation: 3967
You can just use in with one command using full paths. Something like:
php /usr/local/bin/phpunit -c /path/to/project/phpunit.xml > /tmp/phpunit.log 2>&1
It will redirect the std error to the file, too. Then you will see what is actually happening when you run those tests.
Upvotes: 2
Reputation: 1
Use like this commends in Linux system...
sudo crontab -e =>(create cron tab)
-> learn command = */2 * * * * wget (i am created crontab for every 2 mins..)
-> create command for crontab = */2 * * * * wget -q http://localhost/trigger_yoururl
-> ^o run that..
-> ^x exit that..
sudo crontab -l =>(list view for cron tab)
sudo crontab -r =>(remove cron tab)
Upvotes: -1