How to trigger www-data php script from cron of root user ?
After running Nextcloud from docker image cron job is not working: cron job seems not to be working
www-data user not able to start the cron job, and root user not have access to run www-data's php
Console has to be executed with the user that owns the file
config/config.php Current user id: 0
Here is a working solution assuming you've installed cron apt-get install cron
crontab -e
www-data
user* * * * * su www-data -s /bin/bash -c "/usr/local/bin/php /var/www/html/cron.php"
/etc/init.d/cron restart