{"id":62780,"date":"2016-10-21T17:11:50","date_gmt":"2016-10-21T17:11:50","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=62780"},"modified":"2024-03-15T13:04:00","modified_gmt":"2024-03-15T13:04:00","slug":"setup-cron-magento-2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/","title":{"rendered":"How To Setup CRON For Magento 2"},"content":{"rendered":"\n<p>In this post, we will learn to set up cron on the server for Magento 2 cron. In <a href=\"https:\/\/webkul.com\/magento-development\/\">Magento 2 development<\/a> there are many configurations that need cron for the proper working of your Magento.<\/p>\n\n\n\n<p>Some of the tasks which are handled by cron in Magento 2 are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Catalog price rules<\/li>\n\n\n\n<li>Newsletters<\/li>\n\n\n\n<li>Generating Google Sitemaps<\/li>\n\n\n\n<li>Customer Alerts\/Notifications<\/li>\n\n\n\n<li>Reindexing<\/li>\n\n\n\n<li>Automatic updating of currency rates<\/li>\n<\/ul>\n\n\n\n<p>Now we will be going to set up cron on the server.<\/p>\n\n\n\n<p>Run the following command from the terminal<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">crontab -e<\/pre>\n\n\n\n<p>If you are logged in as root user you can specify the cronjob for the Magento file system owner only by specifying the username by using the <strong>-u&nbsp;<\/strong>switch.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">crontab -u &lt;magento file system user&gt; -e<\/pre>\n\n\n\n<p>When you hit the above command, editor option will appear select anyone in which you are comfortable with. In the editor enter the following cronjob.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">* * * * * &lt;path to php binary&gt; &lt;magento install dir&gt;\/bin\/magento cron:run<\/pre>\n\n\n\n<p>In my case I have used the following command.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">* * * * * php \/home\/ayaz\/www\/html\/mage2\/bin\/magento cron:run<\/pre>\n\n\n\n<p>The server setup is complete. Note that the cronjob is configured to run every minute. The schedule can be adjusted as needed. To verify the cron setup, check the <strong>cron_schedule<\/strong> table in your Magento database for entries resembling the following.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/cron_schedule.png\"><img decoding=\"async\" width=\"1148\" height=\"528\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/cron_schedule.png\" alt=\"cron_schedule_image\" class=\"wp-image-62790\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/cron_schedule.png 1148w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/cron_schedule-250x115.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/cron_schedule-300x138.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/cron_schedule-768x353.png 768w\" sizes=\"(max-width: 1148px) 100vw, 1148px\" loading=\"lazy\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>You can learn more on cron in this post:&nbsp;<a href=\"http:\/\/webkul.com\/blog\/magento2-setup-cron-config-path\/\">http:\/\/webkul.com\/blog\/magento2-setup-cron-config-path\/<\/a><\/p>\n\n\n\n<p>That&#8217;s all for cron setup on server for magento,&nbsp;you can query or give feedback in the comments below, it will help us in improving. Hope this post will help you. Thanks \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we will learn to set up cron on the server for Magento 2 cron. In Magento 2 development there are many configurations that need cron for the proper working of your Magento. Some of the tasks which are handled by cron in Magento 2 are: Now we will be going to set <a href=\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":116,"featured_media":61510,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[3770,3771],"class_list":["post-62780","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento2","tag-magento2-cron","tag-magento2-cron-setup"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Setup CRON For Magento 2 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"A step by step beginners guide for CRON setup in Magento 2 development.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Setup CRON For Magento 2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"A step by step beginners guide for CRON setup in Magento 2 development.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-21T17:11:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-15T13:04:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/Magneto-Code-Snippet-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ayaz Mittaqi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ayaz Mittaqi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/\"},\"author\":{\"name\":\"Ayaz Mittaqi\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d\"},\"headline\":\"How To Setup CRON For Magento 2\",\"datePublished\":\"2016-10-21T17:11:50+00:00\",\"dateModified\":\"2024-03-15T13:04:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/\"},\"wordCount\":240,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/Magneto-Code-Snippet-1.png\",\"keywords\":[\"magento2 cron\",\"magento2 cron setup\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/\",\"url\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/\",\"name\":\"How To Setup CRON For Magento 2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/Magneto-Code-Snippet-1.png\",\"datePublished\":\"2016-10-21T17:11:50+00:00\",\"dateModified\":\"2024-03-15T13:04:00+00:00\",\"description\":\"A step by step beginners guide for CRON setup in Magento 2 development.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/Magneto-Code-Snippet-1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/Magneto-Code-Snippet-1.png\",\"width\":825,\"height\":260,\"caption\":\"Ui Component Form\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Setup CRON For Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d\",\"name\":\"Ayaz Mittaqi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Ayaz Mittaqi\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/ayaz-mittaqi024\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Setup CRON For Magento 2 - Webkul Blog","description":"A step by step beginners guide for CRON setup in Magento 2 development.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"How To Setup CRON For Magento 2 - Webkul Blog","og_description":"A step by step beginners guide for CRON setup in Magento 2 development.","og_url":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2016-10-21T17:11:50+00:00","article_modified_time":"2024-03-15T13:04:00+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/Magneto-Code-Snippet-1.png","type":"image\/png"}],"author":"Ayaz Mittaqi","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Ayaz Mittaqi","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/"},"author":{"name":"Ayaz Mittaqi","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d"},"headline":"How To Setup CRON For Magento 2","datePublished":"2016-10-21T17:11:50+00:00","dateModified":"2024-03-15T13:04:00+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/"},"wordCount":240,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/Magneto-Code-Snippet-1.png","keywords":["magento2 cron","magento2 cron setup"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/","url":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/","name":"How To Setup CRON For Magento 2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/Magneto-Code-Snippet-1.png","datePublished":"2016-10-21T17:11:50+00:00","dateModified":"2024-03-15T13:04:00+00:00","description":"A step by step beginners guide for CRON setup in Magento 2 development.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/setup-cron-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/Magneto-Code-Snippet-1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/Magneto-Code-Snippet-1.png","width":825,"height":260,"caption":"Ui Component Form"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/setup-cron-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Setup CRON For Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/3a9d84d349b963ed99f7aead9372dd6d","name":"Ayaz Mittaqi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9a683a7c995567db93858f0305606f73f9075f82330789701e3ed345f6f830aa?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Ayaz Mittaqi"},"url":"https:\/\/webkul.com\/blog\/author\/ayaz-mittaqi024\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/62780","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/116"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=62780"}],"version-history":[{"count":14,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/62780\/revisions"}],"predecessor-version":[{"id":427825,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/62780\/revisions\/427825"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/61510"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=62780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=62780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=62780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}