How to create Scheduled Tasks in Plesk? (Video)

Scheduled tasks in Plesk (also known as Cron Jobs or Task Scheduler) allow you to automate routine processes such as backups, running scripts, or other server-side operations at specified times or intervals.

Here's how you can create scheduled tasks in Plesk.


Step 1: Log in to Plesk

  1. Open your web browser and navigate to your Plesk login page:
    • Example: https://yourdomain.com:8443 or https://your-server-ip:8443.
  2. Enter your username and password, then click Log In.

Step 2: Access the Scheduled Tasks Section

  1. After logging in, go to the Tools & Settings tab in the left sidebar (for admin users) or the Websites & Domains tab (for individual users).
  2. Under the Server Management section (admin view), find and click on Scheduled Tasks.
    • Alternatively, if you're managing tasks for a specific domain or customer, you can go to Websites & Domains and click Scheduled Tasks under the domain's section.

Step 3: Add a New Scheduled Task

  1. In the Scheduled Tasks section, click on the Add Task button to create a new scheduled task.
  2. A new window will open where you can define the task's settings.

Step 4: Define the Task Settings

  1. Task Type:

    • Choose the type of task you want to create. The most common task types are:
      • Run a command: You can execute shell commands or scripts.
      • Run a PHP script: Run a PHP file.
      • Run a program: Execute a program or script file (e.g., Perl, Python).
  2. Command:

    • Enter the specific command or script you want to run. For example:
      • If you want to run a PHP script: /usr/bin/php /var/www/vhosts/example.com/httpdocs/script.php
      • Or for a simple command: /bin/bash /var/www/vhosts/example.com/scripts/backup.sh
  3. Task Schedule:

    • Set the schedule for the task, including how often it should run.
      • Minute: Select the minute(s) when the task should run (e.g., 0 for midnight).
      • Hour: Choose the hour(s) the task should execute.
      • Day of Month: Set which day(s) of the month the task should run.
      • Month: Specify the month(s) for the task to execute.
      • Day of Week: You can also choose specific days of the week (e.g., Sunday to Saturday).
      • Alternatively, you can select predefined intervals, such as:
        • Every day
        • Every week
        • Every month
        • Every minute
  4. Mail Output (Optional):

    • Decide if you want to receive an email notification when the task is executed.
    • You can enter an email address to receive the output or any error messages of the task.
  5. Priority (Optional):

    • You can set the priority for the scheduled task, indicating how important it is in relation to other tasks.

Step 5: Save the Scheduled Task

  1. After entering all the necessary information, click the OK or Save button to create the scheduled task.
  2. Your scheduled task will now appear in the list of active tasks in the Scheduled Tasks section.

Step 6: Manage Scheduled Tasks

  • To edit an existing task, click on the Edit button next to the task.
  • To delete a task, click on the Delete button next to the task.
  • You can also pause or resume tasks if necessary.

Step 7: Verify the Task Execution

  • Depending on the task, you may want to verify that it runs correctly. You can check the output of the task via email (if you selected email notifications), or by looking at the logs for the script or process executed.
  • Some scripts may generate logs you can review for additional details.

Additional Tips

  • Path to Scripts: Make sure the path to any scripts or commands you want to run is absolute, as scheduled tasks typically run under a different environment where relative paths might not work.
  • Permissions: Ensure the scripts or commands you're running have the correct file permissions and are executable by the user running the scheduled task (usually the website or system user).
  • Cron Syntax: If you're familiar with cron jobs, you can use cron syntax to define more complex schedules, such as running a task every 5 minutes or on specific days of the month.

Creating scheduled tasks in Plesk is a powerful way to automate routine operations like backups, script execution, and more. By following the above steps, you can easily create, manage, and monitor these tasks to ensure your server or website runs smoothly without manual intervention.

 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to log in to Plesk? (Video)

Logging into Plesk is a straightforward process, whether you are an administrator or a...

How to edit a file in the Plesk File Manager? (Video)

Editing files directly in the Plesk File Manager is convenient for making quick...

How to Change your Plesk Account Password? (Video)

Changing your Plesk account password is an important step for maintaining account security....

How to Reset Your Plesk Password? (Video)

If you’ve forgotten your Plesk password or need to reset it for security reasons, follow the...

How to change your Plesk contact email address? (Video)

Updating your Plesk contact email address ensures that you receive important notifications...