In this step by step guide I will teach you how to set up a cron job for Nextcloud on your Synology NAS device. What is a cron job? The cron command-line utility, also known as cron job, is a job scheduler on Unix-like operating systems. Users who set up and maintain software environments use cron to schedule jobs to run periodically at fixed times, dates, or intervals.
Make sure you have installed Nextcloud using my step by step guide.
Go to Control Panel / Task Scheduler / Create / Scheduled Task / User-defined script. Follow the instructions in the image below.
Once you click on User-defined script, a new window will open. Follow the instructions below:
- General: In the Task field type in Nextcloud Cron Jobs. Check the “Enabled” option. Select root User.
- Schedule: Select Run on the following days then select “Daily“. Add the Frequency “Every 5 minutes“.
- Task Settings: Copy paste the code below in the Run command area. After that, click OK.
/bin/su -s /bin/sh -c "/usr/local/bin/php80 -f /volume1/web/nextcloud/cron.php" http
After you click OK on STEP 4 a new warning pop up window will open. Click OK.
After you click OK on STEP 5, select your “Nextcloud Cron Jobs” Task then click the “Run” tab. You will be asked to run Nextcloud Cron Jobs – click Yes. Follow the instructions in the image below.
Note: Make sure you have PHP 8 installed on your Synology NAS if you are following my step by step guide for Nextcloud.
Note: If you need to access the php.ini file, read my article on where to Find php.ini.
Note: If you get a “OCP\HintException: : Memcache \OC\Memcache\APCu not available for local cache” error, you need to add value 1 instead of 0 to apc.enable_cli in the php.ini file. Sometimes the settings in Web Station will not be saved so you will need to change them directly in the php.ini file.
This post was updated on Thursday / October 27th, 2022 at 2:26 AM