Cron job as root on new nextcloud instance

Hi there,

I have an old nextcloud server (Debian 11) up and running well and today i’ve just installed latest nexcloud version on new server (latest ubuntu server). I just saw something odd in “Basic settings” section: on old server i have: “The cron.php needs to be executed as system user “www-data”” and on new server i have The cron.php needs to be executed as system user “root”"… Why root? How to change it to www-data user?

Greetings

I’d say to check the file ownership of your Nextcloud installation: all files should be owned by the www-data user, rather than by root.

If that’s not the problem, we’ll need to know more about this new server installation. Did you use a deb package from a repository, or did you do a manual install from the release .tar archives? Is there a particular tutorial you’ve been following up to this point?

Hello I have this issue but think the solution provided is how I have my folder ownership. Below is output of all my files and folders of my installation…

Nextcloud Folder:
drwxr-xr-x 15 www-data www-data 4096 Nov 19 22:01 nextcloud

Nextcloud Folder Contents:
drwxr-xr-x 47 www-data www-data 4096 Nov 3 11:17 3rdparty
drwxr-xr-x 61 www-data www-data 4096 Nov 19 21:59 apps
-rw-r–r-- 1 www-data www-data 19327 Nov 3 11:14 AUTHORS
drwxr-xr-x 2 www-data www-data 4096 Nov 19 22:09 config
-rw-r–r-- 1 www-data www-data 4095 Nov 3 11:14 console.php
-rw-r–r-- 1 www-data www-data 34520 Nov 3 11:14 COPYING
drwxr-xr-x 23 www-data www-data 4096 Nov 3 11:17 core
-rw-r–r-- 1 www-data www-data 6317 Nov 3 11:14 cron.php
drwxrwx— 6 www-data www-data 4096 Nov 19 22:00 data
drwxr-xr-x 2 www-data www-data 12288 Nov 3 11:14 dist
-rw-r–r-- 1 www-data www-data 156 Nov 3 11:14 index.html
-rw-r–r-- 1 www-data www-data 3456 Nov 3 11:14 index.php
drwxr-xr-x 6 www-data www-data 4096 Nov 3 11:14 lib
-rw-r–r-- 1 www-data www-data 283 Nov 3 11:14 occ
drwxr-xr-x 2 www-data www-data 4096 Nov 3 11:14 ocm-provider
drwxr-xr-x 2 www-data www-data 4096 Nov 19 20:50 ocs
drwxr-xr-x 2 www-data www-data 4096 Nov 3 11:14 ocs-provider
-rw-r–r-- 1 www-data www-data 3139 Nov 3 11:14 public.php
-rw-r–r-- 1 www-data www-data 5549 Nov 3 11:14 remote.php
drwxr-xr-x 4 www-data www-data 4096 Nov 3 11:14 resources
-rw-r–r-- 1 www-data www-data 26 Nov 3 11:14 robots.txt
-rw-r–r-- 1 www-data www-data 2452 Nov 3 11:14 status.php
drwxr-xr-x 3 www-data www-data 4096 Nov 3 11:14 themes
drwxr-xr-x 2 www-data www-data 4096 Nov 3 11:16 updater
-rw-r–r-- 1 www-data www-data 382 Nov 3 11:17 version.php