A few days ago I reinstalled Nextcloud. In System Settings > General Settings, I learned that cronjobs should be executed by root.
But this evening I logged in, only to get an error message (that I didn’t save), but it turned out cronjobs had stopped and now suddenly needed to be executed by www-data.
I noticed that cron.php had root:www-data ownership, something I don’t recall seing before.
It depends entirely on how you’ve installed Nextcloud Server and what user you’re running it under.
Conventional deployments typically end up using www-data but that varies for all sorts of reasons. It’s not determined by Nextcloud but by how you’ve installed things.
The check under Admin->Basic Settings just tells you what user you appear to be running your web app’s under. And cron must match that.
The web interface simply shows you the username of the owner of cron.php, which it reads from the file system metadata.
So If the cron.php is owned by “www-data”, the web interface says “www-data”. If the file is owned by “I-changed-the-ownership-to-another-user-although-I-probably-shouldn’t-have”, it says “I-changed-the-ownership-to-another-user-although-I-probably-shouldn’t-have”.
Not sure, maybe after a Nextcloud upgrade? Anyways, www-data, i.e. the web server user, is generally the appropriate owner, and it probably should never have been root in the first place.