0

I have a PHPBU job scheduled in my root crontab:

6 * * * * /etc/phpbu/phpbu.phar --configuration=/var/www/vhosts/example.com/backups/example.com-phpbu-config-hourly.xml

If I sudo the command (minus the 6 * * * * as a sudo-able user, the task runs, performs a backup, and exits as expected, no errors. The config is valid, the phpbu.phar file is root:root with 775.

When the crontab fires (6 minutes past the hour), nothing happens. If I update the crontab entry to append to a text file…:

6 * * * * /etc/phpbu/phpbu.phar --configuration=/var/www/vhosts/example.com/backups/example.com-phpbu-config-hourly.xml >>/tmp/phpbu-crontab.txt

…a zero byte file is created. If I top and tail with something to test if root crontab is running, and make the .phar run more often…:

* * * * * touch /tmp/hello
* * * * * /etc/phpbu/phpbu.phar --configuration=/var/www/vhosts/example.com/backups/example.com-phpbu-config-hourly.xml >>/tmp/phpbu-crontab.txt
* * * * * touch /tmp/goodbye

…I get /tmp/hello, /tmp/goodbye with an updated timestamp every minute (expected) and nothing in /tmp/phpbu-crontab.txt at all. No errors.

I am stumped. I would be very grateful for some pointers or additional things to check.

Thank you in advance for any advice or feedback.

0

OK, solved. I needed to prepend the PHP-CLI:

* * * * * /path/to/php-cli /etc/phpbu/phpbu.phar --configuration=/var/www/vhosts/example.com/backups/example.com-phpbu-config-hourly.xml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.