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.
STEP 1
Please Support My work by Making a Donation.
STEP 2
Make sure you have installed Nextcloud using my step by step guide.
STEP 3
Go to Control Panel / Task Scheduler / Create / Scheduled Task / User-defined script. Follow the instructions in the image below.
STEP 4
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
Note: If you are using php 8.2 instead of php 8.0 change the line above from php80 to php82.
STEP 5
After you click OK on STEP 4 a new warning pop up window will open. Click OK.
STEP 6
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 OK. Follow the instructions in the image below.
Note: Make sure you have PHP 8 or PHP 8.2 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: [0]: 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.
Note: If the instructions above doesn’t help try to add ‘extension = apcu.so‘ to the extension.ini file located at (/usr/local/etc/php82/cli/
This post was updated on Friday / September 20th, 2024 at 4:14 PM