§2024-07-09

For the server to work properly, it's important to configure background jobs correctly. Cron is the recommended setting. Please see the documentation for more information.

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

Save the crontab file and exit the editor. For example, if you’re using nano, you can do this by pressing CTRL + X, then Y to confirm, and Enter to save.

To check if the cron job is working correctly, you can look at the logs. Nextcloud logs can be found in the data/nextcloud.log file within your Nextcloud installation directory. You can also verify the execution by checking the cron job status using:

sudo service cron status

Log in to your Nextcloud web interface as an admin. Go to Settings > Basic settings. Under the Background jobs section, select Cron. Additional Notes: Ensure that PHP CLI is installed on your server and accessible via the php command. You can check this by running php -v. The cron job should be executed by the same user who owns the Nextcloud files to avoid permission issues. If you are using a different user, you may need to adjust the command accordingly. For further details, you can refer to the Nextcloud documentation on configuring background jobs.