Setting Up Cron Jobs Using Plesk

2 min read

Cron jobs allow you to automate repetitive tasks such as running scripts or updating data at specified intervals. With Plesk, customers can easily set up and manage cron jobs for their hosting accounts. Here’s how to do it.

Step 1: Log in to Plesk #

  1. Open your web browser and navigate to your Plesk login page.
  2. Enter your credentials and click Log in.

 

 

Step 2: Navigate to the Scheduled Tasks Section #

  1. In the Plesk dashboard, locate the Websites & Domains section.
  2. Scroll down and click Scheduled Tasks under the domain where you want to set up a cron job.

 

 

Step 3: Add a New Cron Job #

  1. In the Scheduled Tasks interface, click Add Task.
  2. Configure the cron job with the following details:
    • Task Type: Select the type of task (e.g., Run a command).
    • Command: Enter the command or script path to execute (e.g., /usr/bin/php /var/www/vhosts/yourdomain.com/httpdocs/script.php).
    • Run: Specify the frequency using predefined intervals (e.g., daily, weekly) or custom cron expressions.
    • Description: Optionally, add a note to describe the cron job.

 

 

Step 4: Test the Cron Job (Optional) #

  1. Click the Run Now button next to the newly created task to execute it immediately.
  2. Verify that the task runs successfully by checking its output or the expected result (e.g., updated data or logs).

Step 5: Monitor and Edit Cron Jobs #

  1. Return to the Scheduled Tasks section to view all your cron jobs.
  2. Click the Edit icon to modify an existing task.
  3. To disable or delete a task, use the appropriate options next to the task name.

Tips #

  • Use absolute paths for scripts to avoid execution errors.
  • Avoid setting cron jobs to run too frequently to reduce server load.
  • Check logs or script outputs to ensure tasks are running as expected.
Updated on December 30, 2024

What are your feelings

  • Happy
  • Normal
  • Sad