See below how to set up a cron job:
- Log in to your hosting package in Plesk
- Click on Scheduled tasks in Plesk
3. Click to create a new task. You will see the following options:
You will then see 3 options:
- Run a command
- Fetch a URL
- Run a PHP script
You will be asked for the following information:
Command: The path to the PHP file to be executed. The path is relative to your subdomain directory. So if your file on the SFTP server is located here:
"/public/sites/www.domain.ext/wp-cron.php", you only need to enter "wp-cron.php".
The path can be a URL, for example:
wp-cron.php?import_key=RS-zaIeU&import_id=29&action=trigger
Run: Choose a frequency here or choose "manual" and enter the times. How this works is described below.
Description: Enter a name here that describes the task
Notify: You can select to never be notified, only when errors occur or every time. You can also specify a new email address that is different from the main user of the hosting package. If the scheduled task produces a result, the result will be sent to this email address.
How does manual frequency work? With manual frequency, you can set an advanced schedule. This gives you the opportunity to schedule your task down to the minute.
Examples of frequencies
You can also set a frequency for a field using the characters "*", */" and ",". Below are some examples.
Select OK to save or Run Now to check if the task works. You may see an error message with more details if it doesn't work.
To check the Scheduled Tasks that have already been set up, click Scheduled Tasks on the main page (1st image). You will see them listed.