{"id":20104,"date":"2024-05-28T06:44:26","date_gmt":"2024-05-28T06:44:26","guid":{"rendered":"https:\/\/hostvento.com\/kb\/web-hosting\/getting-started-guide\/how-to-use-the-knowledge-base\/how-to-schedule-a-task-in-plesk-for-linux\/"},"modified":"2024-06-17T09:43:00","modified_gmt":"2024-06-17T09:43:00","slug":"how-to-schedule-a-task-in-plesk-for-linux","status":"publish","type":"docs","link":"https:\/\/www.hostvento.com\/kb\/docs\/hosting-faqs\/how-to-schedule-a-task-in-plesk-for-linux\/","title":{"rendered":"How to Schedule a Task in Plesk for Linux?"},"content":{"rendered":"\n<p>Just so you know, Plesk has two different kinds of scheduled tasks:<\/p>\n\n\n\n<p>job that is scheduled by a customer: This kind of job can be created by both administrators and customers. It is carried out on a system user&#8217;s behalf. You are not granted access to the filesystem beyond the website&#8217;s document root while performing such actions.<\/p>\n\n\n\n<p>Task scheduled by an administrator: This kind of task can only be created by an administrator. The root user is the one who is responsible for its execution. You can write to the entire filesystem while doing such actions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Steps to Schedule a Customer Scheduled Task from Plesk UI:<\/h3>\n\n\n\n<p>1. Log in to Plesk.<\/p>\n\n\n\n<p>2. Navigate to&nbsp;<strong>Websites &amp; Domains &gt; example.com &gt; Scheduled Tasks &gt; Add Task<\/strong>.<\/p>\n\n\n\n<p>3. Enter the full path to the script to be executed in the&nbsp;<strong>Command<\/strong>&nbsp;field.<\/p>\n\n\n\n<p>4. Set the task execution time in the&nbsp;<strong>Run<\/strong>&nbsp;field (check an example here).<\/p>\n\n\n\n<p>5. Click on&nbsp;<strong>OK<\/strong>&nbsp;to save changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Steps to Schedule an Administrator Scheduled Task from Plesk UI:<\/h3>\n\n\n\n<p>1. Log in to Plesk.<\/p>\n\n\n\n<p>2. Navigate to&nbsp;<strong>Tools &amp; Settings &gt; Scheduled Tasks &gt; Add Task<\/strong>.<\/p>\n\n\n\n<p>3. Enter the full path to the script to be executed in the&nbsp;<strong>Command<\/strong>&nbsp;field.<\/p>\n\n\n\n<p>4. Set the task execution time in the&nbsp;<strong>Run<\/strong>&nbsp;field.<\/p>\n\n\n\n<p>5. Leave user as root in the&nbsp;<strong>System<\/strong>&nbsp;user field or select another system user to run the task:<\/p>\n\n\n\n<p>6. Click on&nbsp;<strong>OK<\/strong>&nbsp;to save changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Steps to Create\/Edit Scheduled Task from the Commands Line, SSH with a System User Account:<\/h3>\n\n\n\n<p>1. Log in to Plesk.<\/p>\n\n\n\n<p>2. Let the customer connect to the server via SSH on the page&nbsp;<strong>Plesk &gt; Subscriptions &gt; example.com &gt; Web Hosting.<\/strong><\/p>\n\n\n\n<p>3. Access and enable&nbsp;<strong>Access<\/strong>&nbsp;to the server over SSH.<\/p>\n\n\n\n<p>4. Using a system user account connect to the server over SSH.<\/p>\n\n\n\n<p>5. Run the below command to open&nbsp;<strong>crontab<\/strong>&nbsp;<strong>editor<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># crontab -e<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Steps to Create\/Edit the Scheduled Task from the Command Line, SSH with \u201croot\u201d Account:<\/h3>\n\n\n\n<p>1. Using&nbsp;<strong>SSH<\/strong>, connect to the server.<\/p>\n\n\n\n<p>2. Execute the below command to open&nbsp;<strong>crontab<\/strong>&nbsp;<strong>editor<\/strong>&nbsp;for a specific user:<\/p>\n\n\n\n<p>3. Replace&nbsp;<strong>johndoe<\/strong>&nbsp;with the your preferred username.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># crontab -e -u johnoe<\/pre>\n\n\n\n<p>4. Using&nbsp;<strong>cron<\/strong>&nbsp;file syntax, type in the&nbsp;<strong>cron<\/strong>&nbsp;task parameters. For example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">* * * * * \/bin\/echo \"test\" &gt; \/tmp\/testfile<\/pre>\n\n\n\n<p>In this way, you can schedule a task in Plesk for Linux.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just so you know, Plesk has two different kinds of scheduled tasks: job that is scheduled by a customer: This kind of job can be created by both administrators and customers. It is carried out on a system user&#8217;s behalf. You are not granted access to the filesystem beyond the website&#8217;s document root while performing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":23377,"menu_order":293,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-20104","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/20104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/comments?post=20104"}],"version-history":[{"count":2,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/20104\/revisions"}],"predecessor-version":[{"id":20110,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/20104\/revisions\/20110"}],"up":[{"embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/23377"}],"wp:attachment":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/media?parent=20104"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/doc_tag?post=20104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}