1. Home
  2. Docs
  3. General
  4. FAQ
  5. How to setup scheduled task or cron in plesk panel?

How to setup scheduled task or cron in plesk panel?

There are some difference in the procedure for different plesk versions.

Here trying to explain the general procedure.

Setup the cron job in Parallels Plesk Panel:

1. In the Parallels Plesk Panel, go to the ‘Domains‘  or ‘Websites & Domains‘ section.

2. Now select the domain where you want to add the cron job.

3. Click on ‘Scheduled Tasks‘ under Additional Tools.

4. Select the ‘System user’ under whom you want to run the scheduled task.

5. Click ‘Schedule New Task’.

6. Specify the time when you want to run some specific command.

  • Minute- enter the value from 0 to 59
  • Hour- enter the value from 0 to 23
  • Day of the Month- enter the value from 1 to 31
  • Month- enter the value from 1 to 12, or select the month from a drop-down box
  • Day of the Week- enter the value from 0 to 6 (0 for Sunday), or select the day of the week from a drop-down box.

You can schedule the time using the crontab entry format.

  • Enter several values separated by commas. Two numbers separated by a hyphen mean an inclusive range. For example, to run a task on the 4th, 5th, 6th, and 20th of a month, type 4-6,20.
  • Insert an asterisk to specify all values allowed for this field. For example, to run a task daily, type * in the Day of the Month text box.

6) Specify which command to run. Type it into the Command input box.

Click on “OK” once you have entered the command.

The cron command for the XYZ Email Manager is
wget https://SCRIPT INSTALLED PATH/index.php?page=cronjob/send-mail

The cron command for the wordpress plugin Newsletter Manager is
wget https://WORDPRESS INSTALLATION PATH/wp-content/plugins/newsletter-manager/cron.php

  • Note: You will get the path from the settings page in Newsletter Manager. The cron command is different for the premium plugin.

The cron command for the XYZ Admarket is
wget https://SCRIPT INSTALLED PATH/cron/index.php?page=datacron/data-backup

Note: In some servers it will create a file in the server after each cron execution. To prevent this please use the code -O /dev/null –quiet after wget. Eg: wget -O /dev/null –quiet https://SCRIPT INSTALLED PATH/cron/index.php?page=datacron/data-backup

7) Success! The new cron task has been successfully set up.

Note : In some server, they don’t allow to use cron jobs. In such a situation, you can use third party sites like easycron to run the cron.

 

 

Was this article helpful to you? Yes 4 No 5