{"id":744,"date":"2024-11-13T14:36:01","date_gmt":"2024-11-13T14:36:01","guid":{"rendered":"https:\/\/unlimitedhosting.in\/tutorials\/?p=744"},"modified":"2024-11-13T14:36:04","modified_gmt":"2024-11-13T14:36:04","slug":"how-to-create-cron-jobs-in-plesk","status":"publish","type":"post","link":"https:\/\/unlimitedhosting.in\/tutorials\/how-to-create-cron-jobs-in-plesk\/","title":{"rendered":"How to Create Cron Jobs in Plesk Admin Panel"},"content":{"rendered":"\n<p>Cron jobs are scheduled tasks that run automatically at specified intervals. In the Plesk control panel, creating cron jobs is a simple process that allows you to automate various tasks such as running scripts, backups, and sending reports. Here&#8217;s a step-by-step guide to creating cron jobs in Plesk:<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#step-1-log-in-to-plesk\">Step 1: Log in to Plesk<\/a><\/li><li><a href=\"#step-2-navigate-to-the-scheduled-tasks-section\">Step 2: Navigate to the &#8220;Scheduled Tasks&#8221; Section<\/a><\/li><li><a href=\"#step-3-add-a-new-cron-job\">Step 3: Add a New Cron Job<\/a><ul><li><a href=\"#step-4-set-up-the-cron-job\">Step 4: Set Up the Cron Job<\/a><ul><li><a href=\"#1-task-type\">1. Task Type<\/a><\/li><li><a href=\"#2-run-as\">2. Run as<\/a><\/li><li><a href=\"#3-schedule\">3. Schedule<\/a><\/li><li><a href=\"#4-command-or-script\">4. Command or Script<\/a><\/li><li><a href=\"#5-output-and-error-log\">5. Output and Error Log<\/a><\/li><li><a href=\"#6-notifications\">6. Notifications<\/a><\/li><\/ul><\/li><\/ul><\/li><li><a href=\"#step-5-save-the-cron-job\">Step 5: Save the Cron Job<\/a><\/li><li><a href=\"#step-6-verify-the-cron-job\">Step 6: Verify the Cron Job<\/a><\/li><li><a href=\"#troubleshooting-tips\">Troubleshooting Tips<\/a><\/li><li><a href=\"#conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1-log-in-to-plesk\">Step 1: Log in to Plesk<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"777\" height=\"727\" src=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/10\/plesk-control-panel.png\" alt=\"plesk control panel\" class=\"wp-image-649\" style=\"width:357px;height:auto\" srcset=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/10\/plesk-control-panel.png 777w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/10\/plesk-control-panel-300x281.png 300w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/10\/plesk-control-panel-768x719.png 768w\" sizes=\"auto, (max-width: 777px) 100vw, 777px\" \/><\/figure>\n<\/div>\n\n\n<p>First, you need to access your <a href=\"https:\/\/www.plesk.com\/\" rel=\"nofollow noopener\" target=\"_blank\">Plesk control panel<\/a>. Open your browser and navigate to your Plesk login URL (usually something like <code>https:\/\/your-domain.com:8443<\/code>). Enter your username and password to log in.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2-navigate-to-the-scheduled-tasks-section\">Step 2: Navigate to the &#8220;Scheduled Tasks&#8221; Section<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"223\" height=\"497\" src=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Tools-and-Settings.png\" alt=\"Tools and Settings\" class=\"wp-image-739\" style=\"width:140px;height:auto\" srcset=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Tools-and-Settings.png 223w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Tools-and-Settings-135x300.png 135w\" sizes=\"auto, (max-width: 223px) 100vw, 223px\" \/><\/figure>\n<\/div>\n\n\n<ol class=\"wp-block-list\">\n<li>After logging in, you will be on the Plesk dashboard. In the left-hand sidebar, look for the <strong>&#8220;Tools &amp; Settings&#8221;<\/strong> option.<\/li>\n\n\n\n<li>Under <strong>&#8220;Tools &amp; Settings&#8221;<\/strong>, click on <strong>&#8220;Scheduled Tasks&#8221;<\/strong>. This is where you will manage and create cron jobs.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"544\" src=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/scheduled-tasks-cron-Jobs-1024x544.png\" alt=\"scheduled tasks cron Jobs\" class=\"wp-image-749\" style=\"width:650px;height:auto\" srcset=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/scheduled-tasks-cron-Jobs-1024x544.png 1024w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/scheduled-tasks-cron-Jobs-300x159.png 300w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/scheduled-tasks-cron-Jobs-768x408.png 768w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/scheduled-tasks-cron-Jobs-1536x816.png 1536w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/scheduled-tasks-cron-Jobs.png 1592w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"step-3-add-a-new-cron-job\">Step 3: Add a New Cron Job<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"851\" height=\"268\" src=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Add-task.png\" alt=\"Add task in cron jobs\" class=\"wp-image-745\" style=\"width:619px;height:auto\" srcset=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Add-task.png 851w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Add-task-300x94.png 300w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Add-task-768x242.png 768w\" sizes=\"auto, (max-width: 851px) 100vw, 851px\" \/><\/figure>\n<\/div>\n\n\n<p>To create a new cron job:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the <strong>Scheduled Tasks<\/strong> section, click on the <strong>&#8220;Add Task&#8221;<\/strong> button.<\/li>\n\n\n\n<li>A form will appear with several fields that you need to fill out.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-4-set-up-the-cron-job\">Step 4: Set Up the Cron Job<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"697\" src=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Create-a-Cron-jobs-1024x697.png\" alt=\"Create a Cron jobs using Run a command\" class=\"wp-image-746\" style=\"width:488px;height:auto\" srcset=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Create-a-Cron-jobs-1024x697.png 1024w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Create-a-Cron-jobs-300x204.png 300w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Create-a-Cron-jobs-768x523.png 768w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/Create-a-Cron-jobs.png 1235w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>There are multiple settings to configure when creating a cron job. Here&#8217;s a breakdown of each:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"1-task-type\">1. <strong>Task Type<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>From the <strong>Task Type<\/strong> dropdown, choose the task you want to run. You can either run a script or a command.<\/li>\n\n\n\n<li>If you select <strong>Run a command<\/strong>, you can specify the full path of the command or script you want to run.<\/li>\n\n\n\n<li>If you select <strong>Run a PHP script<\/strong>, you can enter the full path to the <a href=\"https:\/\/www.php.net\/\" rel=\"nofollow noopener\" target=\"_blank\">PHP file<\/a> you want to execute.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2-run-as\">2. <strong>Run as<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Choose which user the cron job should run as. Generally, it will be set to your account by default, but you can change this if needed.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"3-schedule\">3. <strong>Schedule<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Plesk provides an easy-to-use interface to specify when the cron job should run. You can set the time using the following options:\n<ul class=\"wp-block-list\">\n<li><strong>Minute<\/strong>: Choose the minute(s) when the job will run.<\/li>\n\n\n\n<li><strong>Hour<\/strong>: Choose the hour(s) for execution.<\/li>\n\n\n\n<li><strong>Day of month<\/strong>: Select the specific day(s) of the month for the task.<\/li>\n\n\n\n<li><strong>Month<\/strong>: Select the month(s) for execution.<\/li>\n\n\n\n<li><strong>Day of week<\/strong>: Set the day(s) of the week.<\/li>\n\n\n\n<li>Alternatively, you can use the <strong>&#8220;Every&#8221;<\/strong> and <strong>&#8220;At&#8221;<\/strong> options for a more straightforward schedule, like &#8220;every 10 minutes&#8221; or &#8220;at midnight.&#8221;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>For example, if you want your cron job to run every day at 3:00 AM, you would set:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Minute: <code>0<\/code><\/li>\n\n\n\n<li>Hour: <code>3<\/code><\/li>\n\n\n\n<li>Day of month: <code>*<\/code><\/li>\n\n\n\n<li>Month: <code>*<\/code><\/li>\n\n\n\n<li>Day of week: <code>*<\/code><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"4-command-or-script\">4. <strong>Command or Script<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you selected <strong>Run a command<\/strong>, enter the full path of the command or script you want to run. For example, if you want to run a PHP script, you might input something like<br><code>\/usr\/bin\/php \/var\/www\/vhosts\/your-domain.com\/httpdocs\/your-script.php<\/code><\/li>\n\n\n\n<li>If you chose <strong>Run a PHP script<\/strong>, enter the path to your PHP file, for example<br><code>\/var\/www\/vhosts\/<a href=\"https:\/\/www.unlimitedhosting.in\/\" data-type=\"link\" data-id=\"https:\/\/www.unlimitedhosting.in\/\" rel=\"nofollow\">unlimitedhosting.in<\/a>\/httpdocs\/your-script.php<\/code><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"740\" src=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/cron-jobs-run-a-php-script-1024x740.png\" alt=\"cron jobs run a php script\" class=\"wp-image-747\" style=\"width:541px;height:auto\" srcset=\"https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/cron-jobs-run-a-php-script-1024x740.png 1024w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/cron-jobs-run-a-php-script-300x217.png 300w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/cron-jobs-run-a-php-script-768x555.png 768w, https:\/\/unlimitedhosting.in\/tutorials\/wp-content\/uploads\/2024\/11\/cron-jobs-run-a-php-script.png 1249w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"5-output-and-error-log\">5. <strong>Output and Error Log<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Optionally, you can configure where the output and errors from the cron job should be logged. You can specify a file path to store any output or errors generated by the job. This can be helpful for debugging.\n<ul class=\"wp-block-list\">\n<li><strong>Standard output log<\/strong>: Enter a file path where standard output will be written (e.g., <code>\/var\/www\/vhosts\/<a href=\"https:\/\/www.unlimitedhosting.in\/domains\/\" data-type=\"link\" data-id=\"https:\/\/www.unlimitedhosting.in\/domains\/\" rel=\"nofollow\">your-domain.com<\/a>\/logs\/cron_output.log<\/code>).<\/li>\n\n\n\n<li><strong>Error log<\/strong>: Similarly, specify a file for error logs.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"6-notifications\">6. <strong>Notifications<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can enable or disable email notifications for the cron job. If you enable this, Plesk will send you an <a href=\"https:\/\/workspace.google.com\/\" rel=\"nofollow noopener\" target=\"_blank\">email<\/a> every time the job is run, with information about the task\u2019s execution and whether it was successful.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-5-save-the-cron-job\">Step 5: Save the Cron Job<\/h2>\n\n\n\n<p>Once you\u2019ve filled out all the necessary details for the cron job, click <strong>&#8220;OK&#8221;<\/strong> or <strong>&#8220;Save&#8221;<\/strong> to create the cron job.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-6-verify-the-cron-job\">Step 6: Verify the Cron Job<\/h2>\n\n\n\n<p>You will now see the new cron job listed under <strong>Scheduled Tasks<\/strong>. To verify that the cron job has been successfully added, you can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Review the cron job&#8217;s settings.<\/li>\n\n\n\n<li>Check any output logs you&#8217;ve set up.<\/li>\n\n\n\n<li>Wait for the scheduled time and ensure that the task is executed as expected.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"troubleshooting-tips\">Troubleshooting Tips<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Permission Issues<\/strong>: If your script fails to execute, make sure that the script has the appropriate file permissions. Use <code>chmod<\/code> to ensure it&#8217;s executable.<\/li>\n\n\n\n<li><strong>Check Logs<\/strong>: If you configured error logs, check the log files for any issues that may have occurred during execution.<\/li>\n\n\n\n<li><strong>Cron Syntax<\/strong>: Make sure your cron syntax is correct. Mistakes in setting up the schedule can result in the task not running.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>Creating cron jobs in Plesk is a straightforward process that allows you to automate various tasks like backups, maintenance scripts, and more. By setting up a cron job, you can <a href=\"https:\/\/www.unlimitedhosting.in\/dedicated-hosting\/\" rel=\"nofollow\">ensure that your server runs task<\/a>s on a regular schedule without manual intervention, saving you time and effort. Whether you&#8217;re a developer, system admin, or website owner, cron jobs are a powerful tool for <a href=\"https:\/\/www.unlimitedhosting.in\/windows-vps-hosting\/\" rel=\"nofollow\">streamlining your server<\/a> management.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cron jobs are scheduled tasks that run automatically at specified intervals. In the Plesk control panel, creating cron jobs is a simple process that allows you to automate various tasks&hellip;<\/p>\n","protected":false},"author":5,"featured_media":748,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2,9],"tags":[24,18,25],"class_list":["post-744","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-control-panels","category-domains","category-hosting","tag-cron-job","tag-plesk","tag-scheduled-tasks"],"_links":{"self":[{"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/posts\/744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/comments?post=744"}],"version-history":[{"count":1,"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/posts\/744\/revisions"}],"predecessor-version":[{"id":750,"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/posts\/744\/revisions\/750"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/media\/748"}],"wp:attachment":[{"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/media?parent=744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/categories?post=744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unlimitedhosting.in\/tutorials\/wp-json\/wp\/v2\/tags?post=744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}