I will give an example of configuring the execution of NextCloud background jobs via Cron, which will work stably in contrast to AJAX background jobs.
Let’s open the crontab of the user on whose behalf the web server is running, for example, in Ubuntu, this is the www-data user:
crontab -u www-data -e
And add the line:
*/5 * * * * php -f /var/www/nextcloud/cron.php
Let’s save the changes, for example, in the nano text editor, press Ctrl+X to exit the editor and y/n to save or discard changes.
Let’s check that the line has been added:
crontab -u www-data -l
The main parameters and select Cron, a little later we will make sure that the tasks are being executed, for example, the inscription “The last task was completed 1 minute ago” will testify to this.
Let’s open NextCloud, go to Settings – Basic settings and select Cron, a little later we will make sure that the tasks are being executed, for example, the inscription “Last job ran 1 minute ago.” will testify to this.
See also my articles:
Using and configuring CRON
Install Nextcloud in Ubuntu