. For managing your website files, see How to Upload Website Files to Plesk. cron jobs) let you run scripts or commands automatically at specified times. Common uses include running maintenance scripts, generating backups, sending scheduled emails, and cleaning up temporary files. This guide covers creating scheduled tasks in Plesk.

Creating a Scheduled Task

  1. Log in to Plesk.
  2. Go to Websites & Domains.
  3. Click the domain name where you want to create the task.
  4. Click Scheduled Tasks (under the Advanced section, or search for it in the top bar).
  5. Click Add Task.
  6. Configure the task:
    • Task type: Select the type of task:
      • Run a command: Execute a server command (e.g., a PHP script or shell command).
      • Fetch a URL: Visit a specific URL (useful for triggering scripts on your website).
      • Run a PHP script: Execute a PHP file on the server.
    • Command/URL/Script path: Enter the command, URL, or script path to execute. For example:
      • Run a command: /usr/bin/php /var/www/vhosts/yourdomain.com/httpdocs/cron.php
      • Fetch a URL: https://yourdomain.com/cron.php
      • Run a PHP script: /var/www/vhosts/yourdomain.com/httpdocs/wp-cron.php
    • Run: Set how often the task should run:
      • Cron style: Enter a cron expression (e.g., * * * * * for every minute, or 0 2 * * * for 2:00 AM daily).
      • Or use the GUI dropdowns to select minute, hour, day of month, month, and day of week.
  7. Click OK or Run Now to save and optionally execute immediately.

Common Cron Expressions

  • * * * * * — Every minute
  • */5 * * * * — Every 5 minutes
  • 0 * * * * — Every hour
  • 0 2 * * * — Every day at 2:00 AM
  • 0 0 * * 0 — Every Sunday at midnight
  • 0 0 1 * * — On the 1st of every month at midnight

Important Notes

  • Scheduled tasks run at the server time zone, which may differ from your local time. Contact your hosting provider to confirm the server time zone.
  • Incorrect cron expressions can cause tasks to run too frequently, consuming server resources. Always test new tasks first.
  • The "Fetch a URL" option is the simplest and safest way to trigger a script on your website.
  • Some hosting providers limit the number of scheduled tasks per domain. Contact support if you need more.

Troubleshooting

Scheduled task is not running:

  • Check that the task is enabled (not suspended).
  • Verify the command, URL, or script path is correct.
  • Check the server time zone — the task may be running at a different time than expected.

Script runs but produces errors:

  • Check the script output by clicking the task name and reviewing the log.
  • Ensure file paths in the command are absolute (full path from server root).

"Maximum number of tasks reached":

  • Contact your hosting provider to increase your scheduled task limit.
Was this answer helpful? 0 Users Found This Useful (0 Votes)