How do I use Hummingbird's "dosmd" in a cronjob

Hi,
I wrote a script that basically checks for the results of a database query on the file-system and copies those files to a Windows machine on the network using Exceed's internal tools, e.g. dosdir, dosmd, u2dos.
Now, the script works perfectly - executed manually. The goal would be to have that script run every night via crontab.
Which brings me to my problem:
dosdir does not seem to have any problem with that, but dosmd has. It gives me the following error:
/opt/local/bin/dosmd: Cannot Open Display
I understand that crond has a different environment as the console I am logging in through but this tool being a command line tool - why does it need a display? I am pretty new to exceed, so I do not know much about it. The main question is: is it possible to execute that command through crond or do I have to settle for the version without creating a new directory (this would mean more work archiving things...)?

Thank you in advance,
Marcus
mhavranekAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
Indeed it shows "dosmd" is not a command line tool. What does it do?
0
mhavranekAuthor Commented:

Attached you will find the part of my script where I use the command (see line 10). 'dosmd' creates directories on a remote DOS/Windows machine. Interestingly enough the previous command seems to work (dosdir), which just checks for the existence of the directory.
BTW: the version of Exceed used here is 6.2 - pretty old as I have seen.
# copy the data
if [ $EXISTS=1 ]
then
  export DOSDIR="I:/PAYROLL_RETRO_TEST/RET5$CHECKDATE"
  
  # check if target directory exists - if not, create it
  /opt/local/bin/dosdir $DOSDIR  >/dev/null 2>&1
  if [ $? -ne 0 ]
  then
    /opt/local/bin/dosmd $DOSDIR
    if [ $? -ne 0 ]
    then
      echo "[`date`] ERROR - Unable to create DOS directory: $DOSDIR"
      exit 255
    else
      # get filenames
      set -A FILENAMES `ls -1 $RESULTSET`
      
      # set counters
      typeset -i index=0 maxIndex=0
      export maxIndex=${#FILENAMES[*]}-1
      
      while (( $index <= $maxIndex ))
      do
        # rename files to be readable by users and copy them to the target dir
        /opt/local/bin/u2dos -ln $RESULTSET"/"${FILENAMES[$index]} $DOSDIR"\\"`echo ${FILENAMES[$index]} | sed s/'\.'/_/`".txt"
        if [ $? -ne 0 ]
        then
          echo "[`date`] ERROR - Unable to copy file $RESULTSET/${FILENAMES[$index]}"
          exit 255
        fi
        export index=$index+1
      done
      
    fi
  else
    echo "[`date`] ERROR - Destination directory already there!"
    exit 255
  fi
fi

Open in new window

0
mhavranekAuthor Commented:
I just found it out: setting the display variable inside my script did the trick. No errors and the files are copied to the destination.

0
woolmilkporcCommented:
dosmd should have a "-display [display]" option.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mhavranekAuthor Commented:
That works too. Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking

From novice to tech pro — start learning today.