I am having massive trouble setting up a cron job in Magento 2Cron job script is running, but Magento order confirmation emails are not sendingCron job doesn't workCustom module cron job not runningMagento 2 Custom cron job is ignoredCron job issue with indexingHelp with Cron on Magento 2Magento 2: How to setup Cron job correctly?Should 2 of the standard cron always be running?Cron job permission issue?Cron Job In Magento

Difference between "drift" and "wander"

How can this shape perfectly cover a cube?

How do credit card companies know what type of business I'm paying for?

I sent an angry e-mail to my interviewers about a conflict at my home institution. Could this affect my application?

Using roof rails to set up hammock

Was the Lonely Mountain, where Smaug lived, a volcano?

Leveling up and Getting Items!

What is the color associated with lukewarm?

My parents claim they cannot pay for my college education; what are my options?

How could I create a situation in which a PC has to make a saving throw or be forced to pet a dog?

Why can't we feel the Earth's revolution?

Do items with curse of vanishing disappear from shulker boxes?

Are there any rules for identifying what spell an opponent is casting?

Should I move out from my current apartment before the contract ends to save more money?

For Saintsbury, which English novelists constituted the "great quartet of the mid-eighteenth century"?

Reflecting Telescope Blind Spot?

Threading data on TimeSeries

Can artificial satellite positions affect tides?

How can I improve readability and length of a method with many if statements?

Why does MAGMA claim that the automorphism group of an elliptic curve is order 24 when it is order 12?

How would Japanese people react to someone refusing to say “itadakimasu” for religious reasons?

How can religions without a hell discourage evil-doing?

How did the European Union reach the figure of 3% as a maximum allowed deficit?

Is it possible for underground bunkers on different continents to be connected?



I am having massive trouble setting up a cron job in Magento 2


Cron job script is running, but Magento order confirmation emails are not sendingCron job doesn't workCustom module cron job not runningMagento 2 Custom cron job is ignoredCron job issue with indexingHelp with Cron on Magento 2Magento 2: How to setup Cron job correctly?Should 2 of the standard cron always be running?Cron job permission issue?Cron Job In Magento






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Sorry if this has already been answered, but I have looked around and have been unable to find the help, I've followed countless tutorials etc, just can't get my head around it.



So I have a Magento 2.1.0 website running, but It needs the standard Magento cron jobs that do the The following tasks.



Catalog Price rules
Sending Newsletters
Generating Google Sitemaps
Customer Alerts/Notifications (product price change, product back to stock)
Automatic updating of currency rates
Scheduled DB logs cleanup



However, when I try via SSH I get permission error when entering this command, so am unable to progress further, despite using the system username that has the valid permissions:



*crontab -u magento_user -e*


So I have tried doing it via plesk, but I get a "No such file exists error" when using this command (using my details obviously):



* * * * * <path to php binary> <magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento install dir>/var/log/magento.cron.log


Apparently Magento.cron.log doesn't exist.



I'm stuck right now, and just really need to get this sorted. I have looked through the files through ftp, and I can't find the cron.php file everywhere seems to be referring too, so i'm completely baffled right now. Does anyone know what I am doing wrong, or what I can do to find out what the issue is.



Thank you for any help in advance.



Kind regards










share|improve this question




























    0















    Sorry if this has already been answered, but I have looked around and have been unable to find the help, I've followed countless tutorials etc, just can't get my head around it.



    So I have a Magento 2.1.0 website running, but It needs the standard Magento cron jobs that do the The following tasks.



    Catalog Price rules
    Sending Newsletters
    Generating Google Sitemaps
    Customer Alerts/Notifications (product price change, product back to stock)
    Automatic updating of currency rates
    Scheduled DB logs cleanup



    However, when I try via SSH I get permission error when entering this command, so am unable to progress further, despite using the system username that has the valid permissions:



    *crontab -u magento_user -e*


    So I have tried doing it via plesk, but I get a "No such file exists error" when using this command (using my details obviously):



    * * * * * <path to php binary> <magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento install dir>/var/log/magento.cron.log


    Apparently Magento.cron.log doesn't exist.



    I'm stuck right now, and just really need to get this sorted. I have looked through the files through ftp, and I can't find the cron.php file everywhere seems to be referring too, so i'm completely baffled right now. Does anyone know what I am doing wrong, or what I can do to find out what the issue is.



    Thank you for any help in advance.



    Kind regards










    share|improve this question
























      0












      0








      0








      Sorry if this has already been answered, but I have looked around and have been unable to find the help, I've followed countless tutorials etc, just can't get my head around it.



      So I have a Magento 2.1.0 website running, but It needs the standard Magento cron jobs that do the The following tasks.



      Catalog Price rules
      Sending Newsletters
      Generating Google Sitemaps
      Customer Alerts/Notifications (product price change, product back to stock)
      Automatic updating of currency rates
      Scheduled DB logs cleanup



      However, when I try via SSH I get permission error when entering this command, so am unable to progress further, despite using the system username that has the valid permissions:



      *crontab -u magento_user -e*


      So I have tried doing it via plesk, but I get a "No such file exists error" when using this command (using my details obviously):



      * * * * * <path to php binary> <magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento install dir>/var/log/magento.cron.log


      Apparently Magento.cron.log doesn't exist.



      I'm stuck right now, and just really need to get this sorted. I have looked through the files through ftp, and I can't find the cron.php file everywhere seems to be referring too, so i'm completely baffled right now. Does anyone know what I am doing wrong, or what I can do to find out what the issue is.



      Thank you for any help in advance.



      Kind regards










      share|improve this question














      Sorry if this has already been answered, but I have looked around and have been unable to find the help, I've followed countless tutorials etc, just can't get my head around it.



      So I have a Magento 2.1.0 website running, but It needs the standard Magento cron jobs that do the The following tasks.



      Catalog Price rules
      Sending Newsletters
      Generating Google Sitemaps
      Customer Alerts/Notifications (product price change, product back to stock)
      Automatic updating of currency rates
      Scheduled DB logs cleanup



      However, when I try via SSH I get permission error when entering this command, so am unable to progress further, despite using the system username that has the valid permissions:



      *crontab -u magento_user -e*


      So I have tried doing it via plesk, but I get a "No such file exists error" when using this command (using my details obviously):



      * * * * * <path to php binary> <magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento install dir>/var/log/magento.cron.log


      Apparently Magento.cron.log doesn't exist.



      I'm stuck right now, and just really need to get this sorted. I have looked through the files through ftp, and I can't find the cron.php file everywhere seems to be referring too, so i'm completely baffled right now. Does anyone know what I am doing wrong, or what I can do to find out what the issue is.



      Thank you for any help in advance.



      Kind regards







      magento2 cron crontab






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 4 '16 at 19:37









      Rhys EvansRhys Evans

      1




      1




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I don't know what you are doing wrong but I can tell you how I set up Magento2 cron on a recent project.



          I have been putting files inside the /etc/cron.d/ folder. This may be specific to certain Linux distributions and may be specific to how a particular Linux box is set up.



          But in theory any file inside the /etc/cron.d/ folder will be run by cron. The syntax is slightly different but this method avoids having to work out which users' crontab to edit.



          So:



          # File : /etc/cron.d/magento2
          # Run Magento2 cron every 7 minutes
          */7 * * * * magento_user php /var/www/html/magento2/bin/magento cron:run


          [Linux commands* to create the file are
          cd /etc/cron.d/
          ls -l
          vim magento2
          ]



          • ls -l will show you the files here already.


          • *you might prefer to type nano magento2 instead of vim magento2, nano being a slightly more user-friendly editor for those unaccustomed to editing text files in Linux


          • please note: add a blank line at the end of this text file after the cron entry so the file ends with an empty line (this may be superstition but there is no harm in it)


          To check that cron is running, on the Linux command prompt enter:



          grep CRON /var/log/syslog



          if that fails (Linux setups vary in where cron logs to) try



          tail -n 100 /var/log/cron



          [if that fails, hit the internet for advice such as this from Benjamin Cane]



          You should see some log entries from various cron jobs that are running. If you do not see any recent entries then perhaps the Linux cron is not running but I think that would be unusual (and a whole different Q&A).



          Eventually you should see a Magento entry in your Linux cron log due to the file you put in /etc/cron.d/ for example I see this:



          CROND[3196]: (magento_user) CMD (php /var/www/html/magento2/bin/magento cron:run)



          Then the main way I check Magento cron is behaving is to study the Magento database table cron_schedule closely (using a tool such as MySQL Workbench).



          If the Linux OS cron is calling Magento2 cron then you should see entries in this table with status pending. Presently you should see status complete or perhaps a useful error message to indicate where the Magento cron failed.



          ==================================



          Adendum



          I re-read your question.




          • cron.php is from Magento 1.x so you should ignore any advice related to that

          • if you want to log to <magento install path>/var/log/some-cron-file.log then you do probably need to create that file first by cd /full-path-to-magento-install/var/log/, ls -l, touch some-cron-file.log and then the harder part: give your new file the correct ownership and permissions for Linux cron to be able to write here. I don't know what they are for you but I know you can work that out. (but you don't really need to make your own log entries, the Linux system will most likely, and can be set to, log cron jobs to syslog or a dedicated log file)





          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f134679%2fi-am-having-massive-trouble-setting-up-a-cron-job-in-magento-2%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I don't know what you are doing wrong but I can tell you how I set up Magento2 cron on a recent project.



            I have been putting files inside the /etc/cron.d/ folder. This may be specific to certain Linux distributions and may be specific to how a particular Linux box is set up.



            But in theory any file inside the /etc/cron.d/ folder will be run by cron. The syntax is slightly different but this method avoids having to work out which users' crontab to edit.



            So:



            # File : /etc/cron.d/magento2
            # Run Magento2 cron every 7 minutes
            */7 * * * * magento_user php /var/www/html/magento2/bin/magento cron:run


            [Linux commands* to create the file are
            cd /etc/cron.d/
            ls -l
            vim magento2
            ]



            • ls -l will show you the files here already.


            • *you might prefer to type nano magento2 instead of vim magento2, nano being a slightly more user-friendly editor for those unaccustomed to editing text files in Linux


            • please note: add a blank line at the end of this text file after the cron entry so the file ends with an empty line (this may be superstition but there is no harm in it)


            To check that cron is running, on the Linux command prompt enter:



            grep CRON /var/log/syslog



            if that fails (Linux setups vary in where cron logs to) try



            tail -n 100 /var/log/cron



            [if that fails, hit the internet for advice such as this from Benjamin Cane]



            You should see some log entries from various cron jobs that are running. If you do not see any recent entries then perhaps the Linux cron is not running but I think that would be unusual (and a whole different Q&A).



            Eventually you should see a Magento entry in your Linux cron log due to the file you put in /etc/cron.d/ for example I see this:



            CROND[3196]: (magento_user) CMD (php /var/www/html/magento2/bin/magento cron:run)



            Then the main way I check Magento cron is behaving is to study the Magento database table cron_schedule closely (using a tool such as MySQL Workbench).



            If the Linux OS cron is calling Magento2 cron then you should see entries in this table with status pending. Presently you should see status complete or perhaps a useful error message to indicate where the Magento cron failed.



            ==================================



            Adendum



            I re-read your question.




            • cron.php is from Magento 1.x so you should ignore any advice related to that

            • if you want to log to <magento install path>/var/log/some-cron-file.log then you do probably need to create that file first by cd /full-path-to-magento-install/var/log/, ls -l, touch some-cron-file.log and then the harder part: give your new file the correct ownership and permissions for Linux cron to be able to write here. I don't know what they are for you but I know you can work that out. (but you don't really need to make your own log entries, the Linux system will most likely, and can be set to, log cron jobs to syslog or a dedicated log file)





            share|improve this answer





























              0














              I don't know what you are doing wrong but I can tell you how I set up Magento2 cron on a recent project.



              I have been putting files inside the /etc/cron.d/ folder. This may be specific to certain Linux distributions and may be specific to how a particular Linux box is set up.



              But in theory any file inside the /etc/cron.d/ folder will be run by cron. The syntax is slightly different but this method avoids having to work out which users' crontab to edit.



              So:



              # File : /etc/cron.d/magento2
              # Run Magento2 cron every 7 minutes
              */7 * * * * magento_user php /var/www/html/magento2/bin/magento cron:run


              [Linux commands* to create the file are
              cd /etc/cron.d/
              ls -l
              vim magento2
              ]



              • ls -l will show you the files here already.


              • *you might prefer to type nano magento2 instead of vim magento2, nano being a slightly more user-friendly editor for those unaccustomed to editing text files in Linux


              • please note: add a blank line at the end of this text file after the cron entry so the file ends with an empty line (this may be superstition but there is no harm in it)


              To check that cron is running, on the Linux command prompt enter:



              grep CRON /var/log/syslog



              if that fails (Linux setups vary in where cron logs to) try



              tail -n 100 /var/log/cron



              [if that fails, hit the internet for advice such as this from Benjamin Cane]



              You should see some log entries from various cron jobs that are running. If you do not see any recent entries then perhaps the Linux cron is not running but I think that would be unusual (and a whole different Q&A).



              Eventually you should see a Magento entry in your Linux cron log due to the file you put in /etc/cron.d/ for example I see this:



              CROND[3196]: (magento_user) CMD (php /var/www/html/magento2/bin/magento cron:run)



              Then the main way I check Magento cron is behaving is to study the Magento database table cron_schedule closely (using a tool such as MySQL Workbench).



              If the Linux OS cron is calling Magento2 cron then you should see entries in this table with status pending. Presently you should see status complete or perhaps a useful error message to indicate where the Magento cron failed.



              ==================================



              Adendum



              I re-read your question.




              • cron.php is from Magento 1.x so you should ignore any advice related to that

              • if you want to log to <magento install path>/var/log/some-cron-file.log then you do probably need to create that file first by cd /full-path-to-magento-install/var/log/, ls -l, touch some-cron-file.log and then the harder part: give your new file the correct ownership and permissions for Linux cron to be able to write here. I don't know what they are for you but I know you can work that out. (but you don't really need to make your own log entries, the Linux system will most likely, and can be set to, log cron jobs to syslog or a dedicated log file)





              share|improve this answer



























                0












                0








                0







                I don't know what you are doing wrong but I can tell you how I set up Magento2 cron on a recent project.



                I have been putting files inside the /etc/cron.d/ folder. This may be specific to certain Linux distributions and may be specific to how a particular Linux box is set up.



                But in theory any file inside the /etc/cron.d/ folder will be run by cron. The syntax is slightly different but this method avoids having to work out which users' crontab to edit.



                So:



                # File : /etc/cron.d/magento2
                # Run Magento2 cron every 7 minutes
                */7 * * * * magento_user php /var/www/html/magento2/bin/magento cron:run


                [Linux commands* to create the file are
                cd /etc/cron.d/
                ls -l
                vim magento2
                ]



                • ls -l will show you the files here already.


                • *you might prefer to type nano magento2 instead of vim magento2, nano being a slightly more user-friendly editor for those unaccustomed to editing text files in Linux


                • please note: add a blank line at the end of this text file after the cron entry so the file ends with an empty line (this may be superstition but there is no harm in it)


                To check that cron is running, on the Linux command prompt enter:



                grep CRON /var/log/syslog



                if that fails (Linux setups vary in where cron logs to) try



                tail -n 100 /var/log/cron



                [if that fails, hit the internet for advice such as this from Benjamin Cane]



                You should see some log entries from various cron jobs that are running. If you do not see any recent entries then perhaps the Linux cron is not running but I think that would be unusual (and a whole different Q&A).



                Eventually you should see a Magento entry in your Linux cron log due to the file you put in /etc/cron.d/ for example I see this:



                CROND[3196]: (magento_user) CMD (php /var/www/html/magento2/bin/magento cron:run)



                Then the main way I check Magento cron is behaving is to study the Magento database table cron_schedule closely (using a tool such as MySQL Workbench).



                If the Linux OS cron is calling Magento2 cron then you should see entries in this table with status pending. Presently you should see status complete or perhaps a useful error message to indicate where the Magento cron failed.



                ==================================



                Adendum



                I re-read your question.




                • cron.php is from Magento 1.x so you should ignore any advice related to that

                • if you want to log to <magento install path>/var/log/some-cron-file.log then you do probably need to create that file first by cd /full-path-to-magento-install/var/log/, ls -l, touch some-cron-file.log and then the harder part: give your new file the correct ownership and permissions for Linux cron to be able to write here. I don't know what they are for you but I know you can work that out. (but you don't really need to make your own log entries, the Linux system will most likely, and can be set to, log cron jobs to syslog or a dedicated log file)





                share|improve this answer















                I don't know what you are doing wrong but I can tell you how I set up Magento2 cron on a recent project.



                I have been putting files inside the /etc/cron.d/ folder. This may be specific to certain Linux distributions and may be specific to how a particular Linux box is set up.



                But in theory any file inside the /etc/cron.d/ folder will be run by cron. The syntax is slightly different but this method avoids having to work out which users' crontab to edit.



                So:



                # File : /etc/cron.d/magento2
                # Run Magento2 cron every 7 minutes
                */7 * * * * magento_user php /var/www/html/magento2/bin/magento cron:run


                [Linux commands* to create the file are
                cd /etc/cron.d/
                ls -l
                vim magento2
                ]



                • ls -l will show you the files here already.


                • *you might prefer to type nano magento2 instead of vim magento2, nano being a slightly more user-friendly editor for those unaccustomed to editing text files in Linux


                • please note: add a blank line at the end of this text file after the cron entry so the file ends with an empty line (this may be superstition but there is no harm in it)


                To check that cron is running, on the Linux command prompt enter:



                grep CRON /var/log/syslog



                if that fails (Linux setups vary in where cron logs to) try



                tail -n 100 /var/log/cron



                [if that fails, hit the internet for advice such as this from Benjamin Cane]



                You should see some log entries from various cron jobs that are running. If you do not see any recent entries then perhaps the Linux cron is not running but I think that would be unusual (and a whole different Q&A).



                Eventually you should see a Magento entry in your Linux cron log due to the file you put in /etc/cron.d/ for example I see this:



                CROND[3196]: (magento_user) CMD (php /var/www/html/magento2/bin/magento cron:run)



                Then the main way I check Magento cron is behaving is to study the Magento database table cron_schedule closely (using a tool such as MySQL Workbench).



                If the Linux OS cron is calling Magento2 cron then you should see entries in this table with status pending. Presently you should see status complete or perhaps a useful error message to indicate where the Magento cron failed.



                ==================================



                Adendum



                I re-read your question.




                • cron.php is from Magento 1.x so you should ignore any advice related to that

                • if you want to log to <magento install path>/var/log/some-cron-file.log then you do probably need to create that file first by cd /full-path-to-magento-install/var/log/, ls -l, touch some-cron-file.log and then the harder part: give your new file the correct ownership and permissions for Linux cron to be able to write here. I don't know what they are for you but I know you can work that out. (but you don't really need to make your own log entries, the Linux system will most likely, and can be set to, log cron jobs to syslog or a dedicated log file)






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Sep 5 '16 at 9:52

























                answered Sep 5 '16 at 9:34









                MalachyMalachy

                54648




                54648



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f134679%2fi-am-having-massive-trouble-setting-up-a-cron-job-in-magento-2%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form