I just switched a moodle on a new server, and I have a problem with the cron.
I would like to use the user www-data to run the cron, but when I let it run, nothing happens. I've tested:
2) or by specifying the user with the command crontab -e -u www-data :
* * * * * /usr/bin/php7.3 /var/www/moodle/admin/cli/cron.php >> /var/log/apache2/moodle/moodle-cron.log 2>&1
3) or put the command in /etc/crontab
but none of the three are working.
The cron works fine with the root user, and the following test works :
crontab -e -u www-data
* * * * * * /usr/bin/php7.3 /tmp/test.php >> /tmp/date.out
If you have an idea, I'll take it !!!