§2024-07-09
- nextcloud , Background jobs
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.
- crontab -e and Add the Nextcloud Cron Job:
*/5 * * * * php -f /var/www/nextcloud/cron.php
- Replace /path/to/nextcloud/ with the actual path to your Nextcloud installation. This line will run the Nextcloud cron job every 5 minutes.
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.
- Verify Cron Job Execution:
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
- Set Nextcloud to Use Cron:
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.