{"id":739,"date":"2017-05-23T12:36:07","date_gmt":"2017-05-23T12:36:07","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=article&#038;p=739"},"modified":"2023-01-12T11:46:05","modified_gmt":"2023-01-12T11:46:05","slug":"setup-manage-cron-jobs","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/setup-manage-cron-jobs\/","title":{"rendered":"How to Setup and Manage Cron Jobs in cPanel"},"content":{"rendered":"<p>In this tutorial, you will learn how to set up and manage Cron Jobs in cPanel.<strong> Cron jobs<\/strong> allow you to automate specific commands or scripts on your site.<\/p>\n<p>You can set a command or script to run at a specific time every day, week, etc.<\/p>\n<h3 id=\"how-to-setup-and-manage-cron-jobs-in-cpanel\" class=\"firstStep\">How to Setup and Manage Cron Jobs in cPanel<\/h3>\n<p><strong><big>1)<\/big><\/strong>\u00a0<a href=\"https:\/\/chemicloud.com\/kb\/article\/how-to-login-into-your-cpanel-or-whm-account\/\" target=\"_blank\" rel=\"noopener noreferrer\">Log into cPanel<\/a>, scroll down to the Advanced section, then click the <strong>Cron Jobs<\/strong>\u00a0icon<\/p>\n<figure id=\"attachment_7630\" aria-describedby=\"caption-attachment-7630\" style=\"width: 643px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7630\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Advanced-Cron-Jobs-1-783x244.png\" alt=\"\" width=\"643\" height=\"200\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Advanced-Cron-Jobs-1-783x244.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Advanced-Cron-Jobs-1-300x94.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Advanced-Cron-Jobs-1-768x240.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Advanced-Cron-Jobs-1-50x16.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Advanced-Cron-Jobs-1-1536x479.png 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Advanced-Cron-Jobs-1-60x19.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Advanced-Cron-Jobs-1-100x31.png 100w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Advanced-Cron-Jobs-1.png 1750w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><figcaption id=\"caption-attachment-7630\" class=\"wp-caption-text\">cPanel &gt; Advanced &gt; Cron Jobs<\/figcaption><\/figure>\n<p><strong><big>2)<\/big> <\/strong>You can have cron(s) send an email every time it runs a command which produces output.<\/p>\n<p><strong><big>3)<\/big><\/strong> You must define exactly when and how often you want the cron job to run. This is made easier by using one of the pre-defined or <strong>common settings<\/strong><\/p>\n    \t\t<div class=\"hts-messages hts-messages--info   hts-messages--withicon \"   >\r\n    \t\t\t    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tPlease note that by choosing one of the common settings, all fields will be filled in automatically.     \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n<p>This also helps you understand what each field means. For this example, we&#8217;ll choose the cron to run <strong>Once per day.\u00a0<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-7632\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Cron-Job-Settings-783x668.png\" alt=\"Cron Job Settings\" width=\"643\" height=\"549\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Cron-Job-Settings-783x668.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Cron-Job-Settings-300x256.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Cron-Job-Settings-768x655.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Cron-Job-Settings-50x43.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Cron-Job-Settings-60x51.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Cron-Job-Settings-100x85.png 100w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Cron-Job-Settings.png 1208w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/p>\n<p><strong><big>4)<\/big><\/strong> Next, enter the command of the script you want to run, including the path. You can find the most common binary paths\u00a0<a href=\"https:\/\/chemicloud.com\/kb\/article\/programming-common-server-scriptbinary-locations\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>here<\/strong><\/a>.<\/p>\n<p>Remember to add a space between the binary and the path. In the example below, note the space between \u2018php\u2019 and \u2018\/home\u2019.<\/p>\n<pre>\/usr\/bin\/php \/home\/username\/script.php<\/pre>\n<p>If you want to stop cron jobs email notifications, add the following code at the end of your cron job:<\/p>\n<pre>\/dev\/null 2&gt;&amp;1<\/pre>\n<p><strong><big>5)<\/big> <\/strong>When you&#8217;re done, click <strong>Add New Cron Job\u00a0<\/strong>button.<\/p>\n<p>That\u2019s it! The cron job has been added with success. You can either create additional cron jobs, and edit or delete existing ones, under the <strong>Current Cron Jobs\u00a0<\/strong>area.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to set up and manage Cron Jobs in cPanel. Cron jobs allow you to automate specific commands or scripts on your site. You can set a command or script to run at a specific time every day, week, etc. How to Setup and&#8230;<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[36],"ht-kb-tag":[],"class_list":["post-739","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-cpanel"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=739"}],"version-history":[{"count":7,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/739\/revisions"}],"predecessor-version":[{"id":7633,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/739\/revisions\/7633"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=739"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=739"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}