How to setup a PHP Cron job or scheduled task in Plesk

Re: Set up a cron job in Plesk, Plesk crontab, Create a PHP cron job in Plesk

Setting up a cron task or scheduled job within Plesk is a piece of cake – once you know how.

First, find your way in to the Plesk Control Panel and hit the “Scheduled Tasks” button, then “Schedule New Task”. The example below will show a working task executing a PHP file named cronjob.php located in /httpdocs (your document root) at 01:00 every morning of every day:

The form looks pretty straight forward however there are some points to note.

  • If you want to run every hour, put an asterisk “*” in the Hour field
  • If you want to run every day, put an asterisk “*” in the Day of Month field
  • If you want to run every month, put an asterisk “*” in the Month field
  • If you want to run everyday, put an asterisk “*” in the Day of Week field

If you have problems, check your asterisks are in the right places and that you cron PHP file is in the right location. Compare the schedule task dialogue boxes carefully and you won’t have any problems.