How to set up cron jobs in Plesk: a full guide
Published on July 10, 2026 8 min read
Learn how to set up cron jobs in Plesk: create scheduled tasks for wp-cron, database backups, cache clearing and your own scripts, with examples.
You should not have to run recurring tasks by hand. With a cron job you let the server run a command, a URL or a script automatically at set times: think of clearing the cache, a daily database backup or keeping wp-cron running reliably. This guide shows you step by step how to set up cron jobs in Plesk, the control panel you use to manage your hosting at LJPc. Below you will find a clear step plan, ready-to-use examples and a few tips to check that your task really runs.
What is a cron job?
A cron job (also called a scheduled task) is a command that the server runs automatically on a fixed schedule. The name comes from cron, the scheduler that runs in the background on Linux servers and checks every minute whether a task is due. You decide what should happen (the command) and when it happens (the schedule).
Cron jobs are useful for anything that needs to run at set times without someone pressing a button. Common examples are scheduled backups, sending queued emails, clearing a cache, fetching data through an API and running maintenance scripts. WordPress relies on scheduled tasks too, but by default it does so in a less reliable way. We will come back to that below.
Before you start
You manage cron jobs entirely yourself in Plesk. First log in to the customer portal and click Log in to Plesk. This opens Plesk without typing a separate password. Make sure you also have the following to hand:
- The command, URL or script you want to run.
- For scripts and commands, the full path, for example
/usr/bin/php. A cron job runs in a bare environment without your personal settings, so short names do not always work. - For WordPress: know where your
wp-config.phpis. - An idea of how often the task should run, such as every 15 minutes or once a night.
How to set up cron jobs in Plesk, step by step
Creating a scheduled task in Plesk takes only a few steps. The plan below works for any task type, whether you fetch a URL or run your own script.
- Open Scheduled Tasks. In the Websites & Domains menu, go to Scheduled Tasks. Here you see an overview of existing tasks.
- Click Add Task. A window opens where you set up the task.
- Choose the task type. You can choose Run a command (run a command or script), Fetch a URL (fetch a web address) and Run a PHP script (run a PHP file). Then fill in the matching command, URL or path.
- Set the schedule. Under Run you decide how often the task runs. Pick a ready-made option such as every 5 minutes or daily, or choose Cron style to fill in the five time fields yourself. Plesk shows in plain language when the task will run, so you can check your input.
- Save and test. Click Run Now to run the task once straight away and see whether everything works. If the result is correct, save the task with OK.
Setting the schedule: the cron format
In Cron style mode the schedule consists of five fields. Each field stands for a part of the time. An asterisk (*) means every value, and */N runs the task every N units. So */15 in the first field means every 15 minutes.
| Field | Meaning | Range |
|---|---|---|
| Minute | Minute | 0 to 59 |
| Hour | Hour (24-hour clock) | 0 to 23 |
| Day of the Month | Day of the month | 1 to 31 |
| Month | Month | 1 to 12 |
| Day of the Week | Day of the week | 0 to 6 (0 is Sunday) |
A few common schedules:
*/15 * * * *runs every 15 minutes.0 3 * * *runs every night at 03:00.0 4 * * 1runs every Monday at 04:00.30 2 1 * *runs on the first day of the month at 02:30.
Note: the time follows the server time zone. Keep that in mind if you want a task to run at an exact moment.
Common cron jobs with examples
Below are four tasks that many customers automate, each with a working example. Replace yourdomain.com, the paths and the login details with your own.
Keeping WordPress wp-cron reliable
WordPress has its own scheduler, wp-cron, for tasks such as publishing scheduled posts, updates and backups. That scheduler only starts when someone visits your site. On a quiet site tasks therefore run late, and on a busy site wp-cron runs too often, which slows the site down. The fix is to switch wp-cron off and let a real cron job start it.
First switch wp-cron off. Open wp-config.php and add this line above the line that reads "That's all, stop editing!":
define('DISABLE_WP_CRON', true);
Then create a task in Plesk of the type Fetch a URL that requests the wp-cron address. This is the simplest method, because you do not have to type a command:
https://yourdomain.com/wp-cron.php?doing_wp_cron
Set the schedule to every 15 minutes (*/15 * * * *). If you prefer a command, choose Run a command with wget:
wget -q -O - "https://yourdomain.com/wp-cron.php?doing_wp_cron" >/dev/null 2>&1
Note: until you have set up a real cron job, WordPress runs no scheduled tasks at all after you switch wp-cron off. So set up the cron job straight away. When you move on to maintenance, also read how to update WordPress safely.
Automating a database backup
With mysqldump you make a copy of your database. In a cron job a daily backup looks like this, for example:
/usr/bin/mysqldump -u DBUSER -p'PASSWORD' DBNAME > /var/www/vhosts/yourdomain.com/backups/db-$(date +\%F).sql
You set the database name, the user name and the password when you create a database in Plesk. Watch out for two things. A percent sign has a special meaning in cron, so write the date as \%F with a backslash in front. And keep the backup outside the public web folder, so nobody can download the file through the browser.
Keep in mind that the password is readable in this command. If you want a complete, safe backup of your files and database in one go, use the built-in backup feature instead. For that, read how to make a website backup.
Clearing the cache
A full cache can keep showing outdated pages. You can clear the cache periodically with a command that suits your system. If you use WordPress with WP-CLI, this command clears the cache:
wp cache flush --path=/var/www/vhosts/yourdomain.com/httpdocs
WP-CLI is not available on every site. If your site uses its own cache folder or a different system, create a small script that cleans the right folder and run that as a cron job.
Running your own PHP script
If you have your own script, for example for an import or a report, choose the type Run a PHP script and give the path relative to your website folder, such as httpdocs/cron/task.php. If you prefer a command, call PHP with the full path:
/usr/bin/php /var/www/vhosts/yourdomain.com/httpdocs/cron/task.php
If your script needs a specific PHP version, check which version is active. If needed, read how to change the PHP version in Plesk.
Checking that your cron job works
A cron job that fails silently is only noticed when something goes wrong. So always check that the task really runs.
- Use Run Now. This runs the task immediately and shows straight away whether it finishes without errors.
- Turn on notifications. In the task window you can have Plesk email the output. That way you are told when something goes wrong.
- Keep the output. Have a command write its result to a log file, so you can read back later what happened.
- Check the timing. If the task does not run at the expected moment, keep the server time zone in mind.
Still stuck? Feel free to contact support and we will help you further.
Frequently asked questions
Do all customers have access to cron jobs in Plesk?
Yes. You set up cron jobs yourself through Scheduled Tasks in Plesk, which you open from the customer portal. You do not need separate server access for it.
What is the difference between wp-cron and a real cron job?
wp-cron is the built-in scheduler in WordPress and only starts when someone visits your site. A real cron job runs at set times through the server, independent of visitors. That is why a real cron job is more reliable.
How often should I run wp-cron?
Every 15 minutes is a safe default for most sites. If you have time-sensitive tasks, such as orders in a web shop, choose every 5 minutes.
Why must I write a percent sign in a cron job with a backslash?
In cron the percent sign has a special meaning. If you want to use it as a normal character, for example in a date with date +\%F, put a backslash in front of it: \%.
Why does my cron job work by hand but not on schedule?
Usually that is down to a short path or a missing setting. A cron job runs in a bare environment, so always use full paths such as /usr/bin/php. Also check the time zone and whether the command expects any input.
Can I switch a cron job off temporarily without deleting it?
Yes. In the Scheduled Tasks overview you can disable a task and enable it again later. That way the setting is kept.