Schedule the execution of scripts or utilities on the server.

### Managing Scheduled Tasks in Plesk


The Task Scheduler in Plesk allows you to automate the execution of scripts and commands at specified times. Here’s how you can manage, create, and troubleshoot scheduled tasks effectively:


**Viewing Scheduled Tasks**


1. **Access Scheduled Tasks:**

   - Navigate to `Tools & Settings > Scheduled Tasks (Cron jobs)` to view all scheduled tasks at both the subscription and server levels.


2. **Sorting Tasks:**

   - You can sort tasks by command, subscription, or schedule. Sorting by schedule is particularly useful for identifying resource-intensive tasks that may cause server load spikes.


3. **Task Management:**

   - For each task, you can:

     - **Change Properties:** Click on the task’s name to modify its settings.

     - **Activate/Deactivate:** Use the respective icons to enable or disable the task.

     - **Run Immediately:** Execute the task immediately by selecting the appropriate option.


4. **Scheduled Tasks Shell Setting:**

   - In Plesk for Linux, tasks are executed in a chrooted shell by default, improving security but limiting user options. To change the shell used for scheduled tasks, go to `Tools & Settings > Scheduled Tasks > Settings`. For more details, refer to the Scheduled Tasks Shell Setting documentation.


**Creating a Scheduled Task**


1. **Add a Task:**

   - Go to `Tools & Settings > Scheduled Tasks > Add Task`.


2. **Select Task Type:**

   - Choose the type of task based on your needs:

     - **Run a Command:** Enter the full path to the executable file, such as binary files, shell scripts, or batch files.

     - **Fetch a URL:** Provide the URL to fetch; there’s no need to include commands like `curl` or `wget`.

     - **Run a PHP Script:** Specify the full path to the PHP script, e.g., `/tmp/script.php`.


3. **Configure Schedule:**

   - Set the frequency, date, and time for the task. By default, the time is in the server’s time zone. To select a different time zone, go to `Tools & Settings > Scheduled Tasks > Settings`.


4. **Additional Settings:**

   - **Description:** Provide a brief description of the task.

   - **System User:** Select the user account under whose security context the task will run.

   - **Notifications:** Configure notifications to alert you about the task’s status.


5. **Test the Task:**

   - Before saving, click **Run Now** to test the task. Ensure it completes without errors. If it fails during testing, resolve the issue before scheduling it.


By effectively managing scheduled tasks, you can automate repetitive tasks, improve server efficiency, and address potential performance issues caused by resource-intensive jobs.