Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Schedule a Task in Plesk on Linux

This guide shows how to make Plesk run a command or script for you at set times.

Plesk2 min read9 steps

What is a scheduled task?

A scheduled task is a job that runs by itself at a time you choose. It is like an alarm clock that starts a program. On Linux, this feature is called cron. A cron job might clear old files each night or run a PHP script every hour.

Steps

  1. Log in to Plesk.
  2. Click Tools & Settings and then Scheduled Tasks. For one website, open Websites & Domains and click Scheduled Tasks under your domain.
  3. Choose the system user the task will run as. Use the user of your website.
  4. Click Add Task.
  5. Choose a Task type. There are three kinds: Run a command, Run a PHP script and Fetch a URL.
  6. Enter the command, script path or web address in the box.
  7. Pick when it should run. You can choose Cron style and fill the five time fields, or pick a simple option like daily.
  8. Add an optional description, so you remember what the task does.
  9. Click OK.

How the time fields work

Cron style has five fields. In order: minute, hour, day of month, month, day of week. A star * means every.

30 2 * * *

This runs the task at 2:30 in the morning, every day.

*/15 * * * *

This runs the task every 15 minutes.

Example task

/usr/bin/php /var/www/vhosts/example.com/httpdocs/cron.php

This runs a PHP file called cron.php. Replace the path with your own. The PHP path may differ on your server, so ask Hostvento support if it fails.

Tip: Click Run Now beside a task to test it. Turn on the notification setting, so Plesk emails you the output or any errors.

Quick recap

  • Scheduled tasks run commands at set times.
  • Find them under Scheduled Tasks.
  • Choose the task type, the command and the time.
  • Test with Run Now.