Scheduled tasks, also called cron jobs, let you run scripts automatically at set times, for example a daily PHP script that updates your website's data. On our Plesk hosting, scheduled tasks are fully self-service in your Plesk control panel.
Please note: for security, command-line (SSH/terminal) access isn't available on our shared hosting. Scheduled tasks run without a full shell, so some command-line features won't work (see "Common issues" below).
Creating a scheduled task
- Log in to your account and open Plesk.
- Go to Websites & Domains and select your domain.
- Click Scheduled Tasks, then Add Task.
- Choose the task type that fits your script:
| Task type | Use it for |
|---|---|
| Run a PHP script | Recommended for most scripts. Runs a PHP file directly, with your chosen PHP version. |
| Fetch a URL | Running a script by visiting a URL, for example a web-based cron endpoint. |
| Run a command | Simple commands only. Shell features like redirects and pipes aren't supported. |
- Set when it should run (hourly, daily, weekly, or a custom cron schedule).
- Click OK to save.
Example: a PHP script with arguments
Task type: Run a PHP script Script path: private/myscript.php Arguments: --config=/path/to/config.php Use PHP version: (choose your preferred version)
Testing your task
Before enabling a new task, use Run Now to test it and check the results. If it doesn't behave as expected, you may need to adjust your script.
Tip: you can create a task and leave it disabled until you've tested it, so it doesn't run unexpectedly.
Getting output and logs
Shell redirects like >> mylog.log 2>&1 don't work in scheduled tasks. To capture your script's output, either:
- Log from inside your script, for example by writing to a log file in PHP, or
- In the task settings, set Notify to "Every time," and enter an email address under "Send notifications to." The task's output will be emailed to you each time it runs.
Common issues
| What you tried | Why it doesn't work | What to do instead |
|---|---|---|
>> file.log 2>&1 | Shell redirects aren't supported | Log from inside your script, or use Notify |
umask 077 before your command | Shell commands aren't run | Set it inside your script (for example, PHP's umask()) |
Commands joined with &&, ; or | | Command chaining isn't supported | Put the steps inside one script, and run it with Run a PHP script |
| Tools like Composer, WP-CLI or Node commands | No command-line access on shared hosting | Contact support to discuss options for your project |
Need extra help?
If you have trouble with Plesk's scheduled task settings, such as the task type, schedule, script path or notifications, contact our support team by chat, phone or email, and we'll be happy to help.
Please note that we're not able to write, review or troubleshoot custom script code. If your script itself needs changes, please contact your developer.
Comments
0 comments
Please sign in to leave a comment.