Announcement

Collapse
No announcement yet.

Template Data Feed Cron Job

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Template Data Feed Cron Job

    For years I have been running Temlate Data Feed cron jobs on my old site for years with no problems. Now I have updated to a ReadyTHeme site but I can't get the crons to work. Here is what I've tried.

    This is the most recent attempt with several updates, outline below, to accommodate the new site. It does not fire Template Data Feed at all.

    wget -q --post-data='Screen=SUTL&Action=SUTL&Store_Code=AntiqueMa ps&Module_Code=exprodf&UserName=xxx&Password=xxx&P rovision=yes&Submit=Login&ExProdF_report=1&include _status=A&ExProdF_Custom_Fields=1&ExProdF_UI=modul es/ui/cssui.mvc' --no-check-certificate -O - 'http://www.geographicus.com/mm5/admin.mvc' > /dev/null


    This was what was running effectively on the old store

    wget -q --post-data='Screen=SUTL&Action=SUTL&Store_Code=AntiqueMa ps&Module_Code=exprodf&UserName=xxx&Password=xxx&P rovision=yes&Submit=Login&ExProdF_report=1&include _status=A&ExProdF_Custom_Fields=1&ExProdF_UI=modul es/ui/mmui.mvc' --no-check-certificate -O - 'http://geographicus.cybrhost.com/mm5/admin.mvc' > /dev/null


    I tried several variants. None work. I changed the mmui.mvc to cssui.mvc since I understand that my new site is cssui. I also changed 'http://geographicus.cybrhost.com/mm5/admin.mvc' to 'http://www.geographicus.com/mm5/admin.mvc'. Otherwise I have made no changes, but, nonetheless, the code is not firing the module in the new website. I have also tried 'http://geographicus.com/mm5/admin.mvc'

    Can any one offer help on this matter?

    Kevin
    __________________________
    GEOGRAPHIUCS ANTIQUE MAPS
    923 Putnam Ave
    Brooklyn,NY 11221
    TEL: 646-320-8650
    www.GEOGRAPHICUS.com

    #2
    Re: Template Data Feed Cron Job

    I would try to request the URL manually in your browser and see if it works, just turn the post variables into query string and set the user/pass back, although this will prevent you from testing if you have a strong password, so may need to change it to something weak temporarily:

    Code:
    http://geographicus.cybrhost.com/mm5/admin.mvc?Screen=SUTL&Action=SUTL&Store_Code=AntiqueMaps&Module_Code=exprodf&UserName=xxx&Password=xxx&Provision=yes&Submit=Login&ExProdF_report=1&include_status=A&ExProdF_Custom_Fields=1&ExProdF_UI=modules/ui/cssui.mvc
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment


      #3
      Re: Template Data Feed Cron Job

      Wowwow! This language is beyond me. What does this mean "just turn the post variables into query string and set the user/pass back"

      What is a query string? Variable? And This: user/pass back?

      Kevin
      __________________________
      GEOGRAPHIUCS ANTIQUE MAPS
      923 Putnam Ave
      Brooklyn,NY 11221
      TEL: 646-320-8650
      www.GEOGRAPHICUS.com

      Comment


        #4
        Re: Template Data Feed Cron Job

        This part:

        --post-data='Screen=SUTL&Action=SUTL&Store_Code=AntiqueMa ps&Module_Code=exprodf&UserName=xxx&Password=xxx& P rovision=yes&Submit=Login&ExProdF_report=1&include _status=A&ExProdF_Custom_Fields=1&ExProdF_UI=modul es/ui/cssui.mvc'

        is saying, make a POST request to http://geographicus.cybrhost.com/mm5/admin.mvc and send the above data to the remote server. You can't simulate that with your browser because it would want you to type it into a form and click submit to generate a POST request. So instead, to see if the job works, you take all of that POST data and make a GET request instead, which is what a browser typically does when you type a URL into its URL box. The username and password were obviously changed to post in the forum, so those need to be set back to the proper values in the example GET request I provided, however, if the password is a good one, you'll get an error, because you can't make a normal web request with something like

        http://.....?Password=^(*&%%(&V

        because the browser will mess it up, so you would need to set your cron user's password back to something weak temporarily while testing.
        David Hubbard
        CIO
        Miva
        [email protected]
        http://www.miva.com

        Comment


          #5
          Re: Template Data Feed Cron Job

          I still don't understand. If I post this, with my password and username changed,

          Code:
          --get-data='Screen=SUTL&Action=SUTL&Store_Code=AntiqueMaps&Module_Code=exprodf&UserName=xxx&Password=xxx&Provision=yes&Submit=Login&ExProdF_report=1&include_status=A&ExProdF_Custom_Fields=1&ExProdF_UI=modules/ui/cssui.mvc'
          in my URL window, it just tries to do a search. Same with this

          Code:
          http://--get-data='Screen=SUTL&Action=SUTL&Store_Code=AntiqueMaps&Module_Code=exprodf&UserName=xxx&Password=xxx&Provision=yes&Submit=Login&ExProdF_report=1&include_status=A&ExProdF_Custom_Fields=1&ExProdF_UI=modules/ui/cssui.mvc'
          and this

          Code:
          wget -q --post-data='Screen=SUTL&Action=SUTL&Store_Code=AntiqueMaps&Module_Code=exprodf&UserName=xxx&Password=xxx&Provision=yes&Submit=Login&ExProdF_report=1&include_status=A&ExProdF_Custom_Fields=1&ExProdF_UI=modules/ui/cssui.mvc' --no-check-certificate -O - 'http://www.geographicus.com/mm5/admin.mvc'  > /dev/null
          Clearly I am missing something.

          Kevin
          __________________________
          GEOGRAPHIUCS ANTIQUE MAPS
          923 Putnam Ave
          Brooklyn,NY 11221
          TEL: 646-320-8650
          www.GEOGRAPHICUS.com

          Comment


            #6
            Re: Template Data Feed Cron Job

            You need to take the specific URL I constructed in the initial reply and correct the username and password, then try that. If the password has complex characters, then you will need to reduce it to just letters/numbers first because, while you can use those in the cron job due to how it's being sent, you can't use it in the manual request attempt.
            David Hubbard
            CIO
            Miva
            [email protected]
            http://www.miva.com

            Comment


              #7
              Re: Template Data Feed Cron Job

              Ok. I'm pretty dense sometimes. The URL you provided, once I changed the login and password, worked perfectly. So I assume some of the basic path and whatnot is correct. What is the next step to troubleshoot this issue?

              Kevin
              __________________________
              GEOGRAPHIUCS ANTIQUE MAPS
              923 Putnam Ave
              Brooklyn,NY 11221
              TEL: 646-320-8650
              www.GEOGRAPHICUS.com

              Comment


                #8
                Re: Template Data Feed Cron Job

                Hmm, I was hoping it would produce an error so we'd know what we need to do to fix it. Since it works from browser with those arguments, which should just be cssui.mvc instead of mmui.mvc from the old store's job, then the issue must be in the cron job. I'd guess one of three things is occurring:

                1) The cron job is not executing
                2) The wget command is not found or not executable by your user account
                3) wget itself is having an error

                This is probably easiest to resolve by having your host resolve it because it will likely require shell access to the server to debug further. If you're able to control your cron jobs, the one remaining thing you can try would be to replace this:

                Code:
                > /dev/null
                with

                Code:
                2>&1
                Then let the cron job run again. That should cause any output the cron job generates to be emailed to you, instead of discarded. However, your server's cron daemon may not be set up to email job output, in which case the change will not do anything and won't give you further information.

                On the hosting side, what we'd do here is simply run the wget command interactively with all the correct arguments, as you, and see what happens.
                David Hubbard
                CIO
                Miva
                [email protected]
                http://www.miva.com

                Comment


                  #9
                  Re: Template Data Feed Cron Job

                  Be sure you are using a temporary simple password. If I recall, when that output is emailed, it will be showing user and password in clear text. Hence, be ready to change it right after you run the cron so nobody will have time to use that revealed password.
                  Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
                  Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
                  Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
                  Facebook http://www.facebook.com/EmporiumPlus
                  Twitter http://twitter.com/emporiumplus

                  Comment


                    #10
                    Re: Template Data Feed Cron Job

                    Thanks. Here is the response I got. It might be there 'concurrent user' issue. I have it set to run every hour, so I'll log out then log back in and see what happens. Could it be that ,since I am running multiple cron jobs at around the same time, each one is trying to log in and getting blocked by the previous cron? If so, is there a way to fix this?
                    __________________________
                    GEOGRAPHIUCS ANTIQUE MAPS
                    923 Putnam Ave
                    Brooklyn,NY 11221
                    TEL: 646-320-8650
                    www.GEOGRAPHICUS.com

                    Comment


                      #11
                      Re: Template Data Feed Cron Job

                      Wouldn't it be better to use the page template based method?
                      http://www.emporiumplus.com/v5/tdfcron.txt

                      Comment


                        #12
                        Re: Template Data Feed Cron Job

                        Originally posted by Geographicus View Post
                        Thanks. Here is the response I got. It might be there 'concurrent user' issue. I have it set to run every hour, so I'll log out then log back in and see what happens. Could it be that ,since I am running multiple cron jobs at around the same time, each one is trying to log in and getting blocked by the previous cron? If so, is there a way to fix this?
                        Add TemporarySession=1 to your jobs and make sure none of your jobs run at the same time. To accomplish the add, you'd want to change the post data to have &TemporarySession=1 on the end of all the other stuff. That will ensure the session does not last longer than the job that is running. For the second issue, if you have jobs that run every hour, you'd need to set one to run at the hour, next to run perhaps at 4 past each hour so the prior one has time to complete, etc.
                        David Hubbard
                        CIO
                        Miva
                        [email protected]
                        http://www.miva.com

                        Comment


                          #13
                          Re: Template Data Feed Cron Job

                          This is really maddening. None of these ideas work. Template data feed just won't run from a cron.

                          Now I am trying the alternate method of creating a template and running it from a URL. I can't even get this to run from a browser. I copied the code exactly, made all the modifications, and when I run it - nothing happens at all. I am trying to run a short feed that only generates 20 products in a list. Normally this runs almost instantly. WIth this template page, not at all.

                          Here is the page template:

                          Code:
                          <mvt:if expr="g.runtdf EQ '123'">
                          <mvt:item name="toolkit" param="sassign|ExProdF_report|7" />
                          <mvt:item name="toolkit" param="sassign|ExProdF_Custom_Fields|1" />
                          <mvt:item name="toolkit" param="sassign|include_status|A" />
                          <mvt:item name="toolkit" param="sassign|send2email|[email protected]" />
                          <mvt:item name="exprodf" />
                          <mvt:if expr="g.cron_continue">
                              <mvt:item name="toolkit" param="sassign|newurl|http://www.geographicus.com/mm5/merchant.mvc?Screen=MAILFEED1&runtdf=123%querystring%" />
                              <mvt:item name="toolkit" param="vglosub|g.newurl,%querystring%,g.TDFQueryString" />
                              <mvt:item name="toolkit" param="headeroutput|Status|301 Moved Permanently" /> 
                              <mvt:item name="toolkit" param="vheaderoutput|Location|g.newurl" /> 
                          </mvt:if>
                          </mvt:if>
                          Here is the URL:
                          Can anyone help?

                          Kevin
                          Last edited by Geographicus; 06-23-15, 11:51 AM.
                          __________________________
                          GEOGRAPHIUCS ANTIQUE MAPS
                          923 Putnam Ave
                          Brooklyn,NY 11221
                          TEL: 646-320-8650
                          www.GEOGRAPHICUS.com

                          Comment


                            #14
                            Re: Template Data Feed Cron Job

                            Never mind, I made it work. In the instructions the fact that you have to have certain items, in addition to tool kit, assigned to the page is not made clear.
                            __________________________
                            GEOGRAPHIUCS ANTIQUE MAPS
                            923 Putnam Ave
                            Brooklyn,NY 11221
                            TEL: 646-320-8650
                            www.GEOGRAPHICUS.com

                            Comment


                              #15
                              Re: Template Data Feed Cron Job

                              I want to thank everyone here who offered advice. It was much appreciated. There is no way I could have figured this out on my own.

                              Kevin
                              __________________________
                              GEOGRAPHIUCS ANTIQUE MAPS
                              923 Putnam Ave
                              Brooklyn,NY 11221
                              TEL: 646-320-8650
                              www.GEOGRAPHICUS.com

                              Comment

                              Working...
                              X