The following crontab command:

5 * * * * www-data /usr/bin/php5 /home/... >> /var/log/piwik_archive.log 2>&1

produce, in /var/log/piwik_archive.log:

/bin/sh: www-data: command not found

How to specify crontab command user ?


Only the system-wide crontab file (usually /etc/crontab) and other system crontab files (usually /etc/cron.d) have the username field. User crontab files don't have this field.


man 5 crontab

[...] regular system-wide crontab file. Unlinke a user's crontab, this file has the username field, as used by /etc/crontab.

| improve this answer | |

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.