How to Schedule a Task in Plesk for Linux?

If you have to run scripts on your server at a specific time, then the system use the facility to automatically run the scripts on your server.

To see all scheduled tasks created for every subscription, as well as those created on the server level, go to Tools & Settings > Scheduled Tasks (Cron jobs).

You can arrange the tasks in order by command, subscription, or by schedule.The later time is very useful for troubleshooting problems with server load spiking - it can be caused through the  resource-intensive scheduled task. You have the ability to change the properties of every task mentioned in the list by clicking on the task’s name. Activate the task name by clicking on the icon, deactivate it with the same click on the icon, or run the task quickly.

Note: By default, the scheduled tasks created by Plesk users in Plesk for Linux are executed in a chrooted shell. It means that the file system root is converted into the corresponding system user’s home directory. It improves security but limits the options for Plesk users. You can change the shell to be used for scheduled tasks of all Plesk users by going to Tools & Settings > Scheduled Tasks > Settings. To know more details about the shell settings, refer to Scheduled tasks shell setting.

To create a scheduled task, go to Tools & Settings > Scheduled Tasks > Add Task. First of all, you need to choose the task type, depending on your purpose:

·         Run a command. Specify the full path to run the executable file. It includes binary files, shell scripts, and batch files.

·         Fetch a URL. Only specify the URL; no need to type the command, such as curl or wget.

·         Run a PHP script. Specify the full script path, for example: /tmp/script.php.

Next, select how many times the task will run and set the desired date and time. The time is in the server zone by default. If you want to select a different time zone, go to Tools & Settings > Scheduled Tasks > Settings. You have the ability to set a description for the task, select the system user in whose security context the task will run, and configure the notifications.

Click Run Now and wait until the task is complete. If the task is completed with an error, then at the time of execution by the scheduler, it will also fail to work unless you find the error and resolve the issue in the correct way.                                                         


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 96