Synology: Make Cron Job Work With Nextcloud

Synology Make Cron Job Work With Nextcloud
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.

Synology User Defined Script

  • STEP 4

Once you click on User-defined script, a new window will open. Follow the instructions below:

  1. General: In the Task field type in Nextcloud Cron Jobs. Check the “Enabled” option. Select root User.
  2. Schedule: Select Run on the following days then select “Daily“. Add the Frequency “Every 5 minutes“.
  3. 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.

Synology Make Cron Job Work With Nextcloud 2

  • STEP 5

After you click OK on STEP 4 a new warning pop up window will open. Click OK.

Synology Make Cron Job Work With Nextcloud 3

  • 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.

Synology Make Cron Job Work With Nextcloud 4

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/conf.d/extension.ini).

Synology Make Cron Job Work With Nextcloud 5

This post was updated on Friday / September 20th, 2024 at 4:14 PM