Cron on Nextcloud

Started by ~Q~, November 16, 2023, 07:20:57 AM

Previous topic - Next topic

~Q~

I tried to use Cron but for what ever reason I did not figure cron out the way Nexcloud docs say it should be.

In Nextcloud Admin panel there are three choices.
AJAX <--- Only good for one user
WEBCRON <--- Supposed to be good for 1-5 users
CRON <--- They way it should be done

I did get webcron to work though.


I created this cron job in the end user control panel: 

/usr/bin/wget -O - https://YOUR-NEXCLOUD-SERVER.COM/cron.php >/dev/null 2>&1


This is what Nexcloud says is the prefered method:

crontab -u www-data -e

And append this line:

*/5  *  *  *  * php -f /var/www/nextcloud/cron.php


Source: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html

When I try it the error is that it needs sudo to do "-u" but it needs to be done by the account directory owner.
Nextcloud says it must be done by the directory owner. It is not a such a good idea to give a enduser account shell access with sudo

When I  use "crontab -u www-data -e" with sudo cenos says there is no " www-data" user. <--- what would it be called in CWP?

Any idea how to accomplish this?



O

Painkiller88

hi,

you don't need to give an enduser the permission.

create a user cronjob as this user, you can do this from the cwp admin portal
You don't need to give the user shell access.

Starburst

wget downloads to linux.

Why are you running that in a cron to download cron.php?