{"id":350,"date":"2021-06-30T17:39:46","date_gmt":"2021-06-30T14:39:46","guid":{"rendered":"http:\/\/wp.plumserver.com\/learn\/?p=350"},"modified":"2022-10-06T11:54:17","modified_gmt":"2022-10-06T08:54:17","slug":"how-to-setup-a-cron-job-in-magento","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/learn\/magento-1-setup-cron-job","title":{"rendered":"How to Set Up a Cron Job in Magento"},"content":{"rendered":"\n<p>In order for your Magento to function properly, you need to set up a Magento Cron Job in your cron tab. There are two ways to set up Cron Job.<\/p>\n\n\n\n<h2>Configuring Magento Cron Job using Command Line<\/h2>\n\n\n\n<h3 id=\"configuring-cron-job-with-the-help-of-command-line\">Step 1. Connect to Magento server using SSH<\/h3>\n\n\n\n<p>Connect to the Magento server using SSH. Read more detailed information on how to connect to your server using SSH, if you use <a href=\"https:\/\/mediatemple.net\/community\/products\/dv\/204404604\/using-ssh-in-putty-\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">Windows OS<\/a> or <a href=\"https:\/\/mediatemple.net\/community\/products\/dv\/204405144\/using-ssh-in-terminal.app-(mac-os-x)\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">MAC OS or Linux OS<\/a>.<\/p>\n\n\n\n<h3>Step 2. Open the cron tab editor<\/h3>\n\n\n\n<p>Once you&#8217;ve connected to the Magento server &#8211; please execute the following command in order to edit cron tab.<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">crontab -e<\/code><\/pre><\/div>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"143\" src=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_1-1024x143.jpg\" alt=\"\" data-id=\"352\" data-full-url=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_1.jpg\" data-link=\"http:\/\/wp.plumserver.com\/learn\/how-to-setup-a-cron-job-in-magento\/attachment\/magento_cron_job_in_magento_1\/\" class=\"wp-image-352\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_1-1024x143.jpg 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_1-300x42.jpg 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_1-768x107.jpg 768w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_1.jpg 1206w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>After this command has been performed &#8211; the cron tab editor will open.<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"577\" src=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_2-1024x577.jpg\" alt=\"\" data-id=\"353\" data-full-url=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_2.jpg\" data-link=\"http:\/\/wp.plumserver.com\/learn\/how-to-setup-a-cron-job-in-magento\/attachment\/magento_cron_job_in_magento_2\/\" class=\"wp-image-353\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_2-1024x577.jpg 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_2-300x169.jpg 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_2-768x432.jpg 768w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_2.jpg 1206w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<h3>Step 3. Copy the code to set up a cron job<\/h3>\n\n\n\n<p>Add the following lines of the code to set up the cron jobs:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">0,5,10,15,20,25,30,35,40,45,50,55 * * * * \/bin\/sh \/absolute\/path\/to\/magento\/cron.sh<\/code><\/pre><\/div>\n\n\n\n<p>where <strong>absolute\/path\/to\/magento\/<\/strong> &#8211; is the path to the specific folder of your Magento installation.<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"549\" src=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_3-1024x549.jpg\" alt=\"\" data-id=\"354\" data-full-url=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_3.jpg\" data-link=\"http:\/\/wp.plumserver.com\/learn\/how-to-setup-a-cron-job-in-magento\/attachment\/magento_cron_job_in_magento_3\/\" class=\"wp-image-354\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_3-1024x549.jpg 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_3-300x161.jpg 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_3-768x412.jpg 768w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_3.jpg 1206w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>Save your changes after you finish editing the file.<\/p>\n\n\n\n<h2 id=\"configuring-cron-job-with-the-help-of-hosting-panel\">Configuring Magento Cron Job using Hosting Panel<\/h2>\n\n\n\n<p>In order to configure Cron Job, you can also use your Hosting Panel. Almost all hosting providers offer a panel where you can set up Cron Job for Magento. Please, follow the instructions below to configure Cron Job for Magento correctly.<\/p>\n\n\n\n<p>1. Log into your hosting panel and in the Cron Job settings section, set up the execution of the following script every 5 minutes:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">\/bin\/sh \/absolute\/path\/to\/magento\/cron.sh<\/code><\/pre><\/div>\n\n\n\n<p>2. For more information on how to set up Cron Job in cPanel read this <a href=\"https:\/\/www.hostgator.com\/help\/article\/how-do-i-create-and-delete-a-cron-job\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">article<\/a>. In order to set up Cron Job with the Nexcess hosting &#8211; please read <a href=\"https:\/\/help.nexcess.net\/magento-2\/how-to-configure-magento-2-cron-jobs\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">here<\/a>.<\/p>\n\n\n\n<h2 id=\"magento-cron-checker-script\">Magento cron checker script<\/h2>\n\n\n\n<p>In terms of Plumrocket Magento extensions &#8211; if the Cron Job settings were configured incorrectly, there will be the following error message shown on the extension configuration page, like it is shown on the screenshot below.<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"458\" src=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_missing_crontab-1024x458.png\" alt=\"\" data-id=\"356\" data-full-url=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_missing_crontab.png\" data-link=\"http:\/\/wp.plumserver.com\/learn\/how-to-setup-a-cron-job-in-magento\/attachment\/magento_cron_job_missing_crontab\/\" class=\"wp-image-356\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_missing_crontab-1024x458.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_missing_crontab-300x134.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_missing_crontab-768x343.png 768w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_missing_crontab.png 1206w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>After you set up Cron Job properly, this message will disappear (sometimes it might take up to <strong>30 minutes<\/strong>). Note that this message will not be removed instantly, since the tasks are being executed within the set periodicity.<\/p>\n\n\n\n<p>Also, you can use the special script in order to check the proper functioning of Cron Job tasks and its settings. In order to check the status of the cron by the means of the script &#8211; please follow the steps below.<\/p>\n\n\n<ol>\n<li>\n        Download the <a rel=\"nofollow\" href=\"\/docs\/wp-content\/uploads\/2020\/05\/magento-cron-checker.zip\">magento-cron-checker.zip<\/a> archive and unzip it.\n    <\/li>\n<li>\n        Upload it to the root directory of the site as shown below:\n    <\/li>\n<\/ol>\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Detailed description:<\/p>\n\n\n\n<ol><li><strong>This is your client side.<\/strong> You will see the script file.<\/li><li><strong>This is your root directory on server side.<\/strong> This is where the file should be uploaded.<\/li><li><strong>All the files must be uploaded to the server.<\/strong> Select the file and press the right mouse button<\/li><li><strong>Select the &#8220;Upload&#8221; option in order to upload the file to the server.<\/strong><\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"401\" src=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script-1024x401.png\" alt=\"\" data-id=\"357\" data-full-url=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script.png\" data-link=\"http:\/\/wp.plumserver.com\/learn\/how-to-setup-a-cron-job-in-magento\/attachment\/magento-cron-check-script\/\" class=\"wp-image-357\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script-1024x401.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script-300x117.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script-768x301.png 768w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script.png 1206w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>3. Now enter the script path in your browser&#8217;s address bar and follow this address. The path format is:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">www.yourdomain.com\/magento-cron-checker.php<\/code><\/pre><\/div>\n\n\n\n<p>where &#8220;yourdomain&#8221; is the name of your domain.<\/p>\n\n\n\n<p>The screenshot below displays the page that will appear after you successfully run the script:<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"1024\" height=\"211\" src=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script-1-1024x211.png\" alt=\"\" data-id=\"358\" data-full-url=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script-1.png\" data-link=\"http:\/\/wp.plumserver.com\/learn\/how-to-setup-a-cron-job-in-magento\/attachment\/magento-cron-check-script-1\/\" class=\"wp-image-358\" srcset=\"https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script-1-1024x211.png 1024w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script-1-300x62.png 300w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script-1-768x158.png 768w, https:\/\/plumrocket.com\/learn\/wp-content\/uploads\/2021\/06\/Magento-cron-check-script-1.png 1206w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/li><\/ul><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In order for your Magento to function properly, you need to setup a Magento Cron Job in your cron tab. Learn how to set up Cron Job in two ways: with the help of command line and hosting panel.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[126],"tags":[10,131,132],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Set Up a Cron Job in Magento - Magento Tutorials for Beginners &amp; Professionals<\/title>\n<meta name=\"description\" content=\"In order for your Magento to function properly, you need to set up a Magento Cron Job in your corn tab. Learn how to do it in a few steps.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/learn\/magento-1-setup-cron-job\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Up a Cron Job in Magento - Magento Tutorials for Beginners &amp; Professionals\" \/>\n<meta property=\"og:description\" content=\"In order for your Magento to function properly, you need to set up a Magento Cron Job in your corn tab. Learn how to do it in a few steps.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/learn\/magento-1-setup-cron-job\" \/>\n<meta property=\"og:site_name\" content=\"Magento Tutorials for Beginners &amp; Professionals\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-30T14:39:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-06T08:54:17+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/wp.plumserver.com\/learn\/wp-content\/uploads\/2021\/06\/Magento_cron_job_in_magento_1-1024x143.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/350"}],"collection":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/comments?post=350"}],"version-history":[{"count":8,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/350\/revisions"}],"predecessor-version":[{"id":1227,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/posts\/350\/revisions\/1227"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/media?parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/categories?post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/learn\/wp-json\/wp\/v2\/tags?post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}