Cron Errors

  • Creator
    Topic
  • #51700
    Jared Miller
    Participant

      Using the following script:

      Code:


      DATE=`date +%m%d%y`
      setsite jayhawk
      hcicmd -p ftp -c ‘moblico_conf_ob pstop’
      cd /hci/root3.8.1P/jayhawk/exec/processes/ftp
      mv conf_moblico /home/hci/moblico/conf$DATE.csv
      cd /home/hci/moblico
      hcicmd -p ftp -c ‘moblico_conf_ob pstart’

      When running it from command line everything works fine, but when it runs through the cron I get the following errors:

      Code:


      No HCIROOT set at /hci/bin/hcisetenv line 138.
      /home/hci/ftpscripts/ftp_moblio_conf[3]: hcicmd:  not found.
      /home/hci/ftpscripts/ftp_moblio_conf[7]: hcicmd:  not found.

      I am not sure how to correct this…anyone have an idea?  Thanks in advance.

    Viewing 2 reply threads
    • Author
      Replies
      • #71354
        Shibu Mathew
        Participant

          dont you need “set root” before set site ?

        • #71355
          Sam Craig
          Participant

            Here is code from one of our cron jobs.

            It sets the environment variables and we use the full path for the hcicmd.

            Might be over kill, but it works.

            ## Setup hci environment

            export ROOT=”/quovadx/qdx5.5/integrator”

            export FPATH=$FPATH:/quovadx/qdx5.5/integrator/kshlib

            export PATH=$PATH:$ROOT/bin

            export SITE=”pimprod”

            setroot $ROOT

            ## Run the setsite command to the region you want to process

            setsite $SITE

            ## Start the thread

            /quovadx/qdx5.5/integrator/bin/hcicmd -p process_2 -c “nextgen5_ob pstart”

            Hope this helps…..

          • #71356
            Chris Williams
            Participant

              cron jobs do not default to running with the same environment as the user who creates the job. You must explicitly establish the environment variables.

              You can do them in the individual cron scripts as Sam does above, or you can make them apply to ALL jobs in the crontab file by defining them in that file prior to the job entries.

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