hcicyclesavemsgs (3.8.1P -> 5.3)

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf hcicyclesavemsgs (3.8.1P -> 5.3)

  • Creator
    Topic
  • #48190
    Traci Yelton
    Participant

      I am having trouble w/getting this command structured properly in cron.  I did see the 2 entries posted to this forum, but my entry is a little different.

      Here is my current entry for 3.8.1P (which works):

      #Cycle the interface save message files

      55 23 * * * /usr/bin/ksh -c ‘eval `/hci/bin/hcisetenv -root ksh /hci/root3.8.1P sflaprd`;hcicyclesavemsgs -d -o 14’ >/tmp/cyclemsgprd.log 2>&1

      Here is my changed entry to reflect the new directory structure for 5.3:

      #Cycle the SFLADEV interface save message files

      05 17 * * * /usr/bin/ksh -c ‘eval `/quovadx/qdx5.3/integrator/sbin/hcisetenv -root ksh /quovadx/qdx5.3/integrator sfladev`;hcicyclesavemsgs -d -o 14’ >/tmp/cyclemsgdev.log 2>&1

      I have changed the first line of the command to reflect the correct location for perl.  Then I also ran the hcicyclesavemsgs straight from the command line after executing the SETROOT / SETSITE commands.  the command runs fine when called manually.  

      However, when i run the above cron job for the 5.3 environment, this is the error i get:

      $ less /tmp/cyclemsgdev.log

      /usr/bin/ksh: hcicyclesavemsgs:  not found.

      So it appears that the first part of the command, which executes the ‘hcisetenv -root ksh’ is not setting the root env variable properly, because it is trying to find the hcicyclesavemsgs command in the wrong location.

      What do I have wrong in this entry?  Thanks in advance for your help!

    Viewing 5 reply threads
    • Author
      Replies
      • #57957
        Traci Yelton
        Participant

          anyone?

        • #57958
          Ed Mastascusa
          Participant

            One suggestion would be to use a fully qualified path to hcicyclesavemsgs in the cron command in the same way that you are for the hcisetenv command.

            If your cron job is not running as the same user as when you’re running manually, then cron’s environment “PATH” variable may be different

          • #57959
            Rentian Huang
            Participant

              Traci,

              Do you need to add “/hci” in front of /quovadx/qdx5.3/… ?

              Sam

            • #57960
              Mike Grieger
              Participant

                You could always just call a script from cron – that’s what I decided to do for our cyclesave.

                My cron statment just calls:     /hci/scripts/cyclemsgs > /tmp/cyclemsg.log 2>&1

                Then my cyclemsgs script sets the root and inititates the cycle of all desired sites.  If you try this route, just make sure permissions on the script are correct.

                {cyclemsgs:}

                #!/usr/bin/ksh

                setroot /hci/qdx5.3/integrator

                setsite prodmck

                hcicyclesavemsgs -d -o 14

                setsite prodsms

                hcicyclesavemsgs -d -o 14

                setsite prodepr

                hcicyclesavemsgs -d -o 14

                setsite prodtrans

                hcicyclesavemsgs -d -o 14

              • #57961
                Craig Weldy
                Participant

                  Traci.

                     Another problem you may be running into is the nature of the cron.  When you login to a unix box as a user, it automatically runs a .profile that sets up paths and environment variables.  When cron runs however, it does not run the .profile for the user it is running as.

                    So you could have cron run as the same user you login as and the path and environment variables will not necessaraly be the same.

                     Just like Mike, I have all my cron jobs run a shell script.  In the shell script I setup and env variables or path’s I need to run the commands in the script.  This also allows me to make modifications to the script without having to mess with the cron.

                  Craig Weldy
                  Senior Interface Analyst
                  Beacon Health System
                  South Bend, In, 46615

                • #57962
                  Traci Yelton
                  Participant

                    Thanks so much for everyone’s responses.  I ended up putting the env var settings in a script and firing the cycle save from there.  

                    This is a great learning experience; everyone that replies has such valuable information, so thanks to you all!

                    Merry Christmas 🙂

                Viewing 5 reply threads
                • The forum ‘Cloverleaf’ is closed to new topics and replies.