This is my "crontab -e" * * * * * cd /var/www/clients/client1/web1/web/billing2/artisan && /usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1 * * * * * /usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done * * * * * /usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done Does first line (in bold) has correct syntax for crontab? According to Invoice Ninja documentation they have the following: cd /path/to/root/folder && /usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1
The syntax looks fine. Is that really supposed to run as root? You can create a cronjob as the website user, and that's much preferred if the software functions that way.
Thanks @Jesse Norell. Thanks for checking syntax, I appreciate it. I agree. I just wanted to make sure cron job works as expected, I'll create cron job under website user.
This is my cron job under SITES > CRON JOBS * * * * * cd /var/www/clients/client1/web1/web/billing2/ && /usr/bin/php7.4 artisan schedule:run >> /dev/null 2>&1 How can I add this cron to run as www-data
In root's crontab you could use sudo. Alternately create the cronjob as www-data, or put it in /etc/crontab, which has a column for the user.