Author Topic: Cron on Nextcloud  (Read 872 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Cron on Nextcloud
« on: November 16, 2023, 07:20:57 AM »
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: 

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

This is what Nexcloud says is the prefered method:

Code: [Select]
crontab -u www-data -e
And append this line:

Code: [Select]
*/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

Offline
**
Re: Cron on Nextcloud
« Reply #1 on: November 16, 2023, 06:03:48 PM »
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.

Offline
****
Re: Cron on Nextcloud
« Reply #2 on: November 16, 2023, 10:17:46 PM »
wget downloads to linux.

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