1752661 Members
6084 Online
108788 Solutions
New Discussion юеВ

Re: sftp

 
khilari
Regular Advisor

sftp

Hi guys, I am having this sftp problem. The script that I am using to send any entry names EMERGIS837 that gets generated is as follows. I have included the path and every thing.

(sjh): /ftpscripts $ cat copy_with_env
BLT_LIBRARY=/quovadx/qdx5.2/integrator/tcl/lib/blt8.0
CLASSPATH=/quovadx/qdx5.2/integrator/prodsite/java_uccs:.:/quovadx/qdx5.2/integrator/clgui/l
ib/cljava.jar:/quovadx/qdx5.2/integrator/java_uccs:
DBDPATH=/quovadx/qdx5.2/integrator/prodsite/exec/databases
DBFPATH=/quovadx/qdx5.2/integrator/prodsite/exec/databases
DBTMP=/quovadx/qdx5.2/integrator/prodsite/exec/databases
FPATH=/quovadx/qdx5.2/integrator/kshlib
HCILICFILE=/quovadx/qdx5.2/integrator/vers/license.dat
HCIROOT=/quovadx/qdx5.2/integrator
HCISITE=prodsite
HCISITEDIR=/quovadx/qdx5.2/integrator/prodsite
HCIVERSION=5.2
HOME=/home/hci
LOGNAME=hci
PATH=/quovadx/qdx5.2/integrator/prodsite/bin:/quovadx/qdx5.2/integrator/prodsite/scripts:/qu
ovadx/qdx5.2/integrator/bin:/quovadx/qdx5.2/integrator/contrib:/quovadx/qdx5.2/integrator/sb
in:/quovadx/qdx5.2/integrator/dbms/bin:/quovadx/qdx5.2/integrator/tcl/bin:/quovadx/qdx5.2/in
tegrator/clgui/bin:/quovadx/qdx5.2/integrator/clgui/java/bin:/quovadx/qdx5.2/integrator/user
cmds:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/hci/bin:/usr/bin/X11:/sbin:.:/usr/local/bin:/usr
/local/scripts
SHLIB_PATH=/quovadx/qdx5.2/integrator/clgui/java/lib/PA_RISC:/quovadx/qdx5.2/integrator/clgu
i/java/lib/PA_RISC/hotspot:/quovadx/qdx5.2/integrator/lib:/quovadx/qdx5.2/integrator/bin:/qu
ovadx/qdx5.2/integrator/tcl/lib:/quovadx/qdx5.2/integrator/dbms/lib:/usr/lib:/lib:/shlib:/us
r/shlib:/usr/lib/dld.sl
SHXMON_INTERVAL=5
TCLX_LIBRARY=/quovadx/qdx5.2/integrator/tcl/lib/tclX8.2
TCL_LIBRARY=/quovadx/qdx5.2/integrator/tcl/lib/tcl8.3
TIX_LIBRARY=/quovadx/qdx5.2/integrator/tcl/lib/tix4.1
TKX_LIBRARY=/quovadx/qdx5.2/integrator/tcl/lib/tkX8.2
if [ -f /home/ops/wsib/ftpscripts/EMERGIS837* ]
then
/quovadx/qdx5.2/integrator/tcl/bin/expect /home/ops/wsib/ftpscripts/SFTP_EMERGIS
wait
mv /home/ops/wsib/ftpscripts/EMERGIS837* /home/ops/wsib/ftpscripts/sent_wsibfiles
else
banner jjjj
fi

Now, when I put this command on cron, the file does get transmitted but I get the following error:

/usr/lib/dld.sl: Can't find path for shared library: libtcl8.3.sl
/usr/lib/dld.sl: No such file or directory
/home/ops/wsib/ftpscripts/copy_with_env[23]: 25367 Abort(coredump)


*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:

/home/ops/wsib/ftpscripts/copy_with_env


Now, I did I find on /usr/lib/dld.sl and it does exist. I put that entry in the PATH first and then the SHLIB_PATH but still I get the error above in the mail. Although, the file gets transmitted but as I have to cron it, I am getting a core dump.
4 REPLIES 4
spex
Honored Contributor

Re: sftp

Hi,

expect has an unsatisfied tcl/tk dependency. See this thread:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=272707

PCS
khilari
Regular Advisor

Re: sftp

Well, the thread talks about having issues with running expect, mine runs but cant cron it. ( Although we both have the same errors). But, whats the reason that i can run it manually but not through a cron.
Mike Keighley
Frequent Advisor

Re: sftp

If the expect script runs OK when logged in as yourself, but not under cron, that will be because cron jobs do not inherit your shell environment.

In this case, you probably need something like this at the top of your script:
export PATH=`cat /etc/PATH`
export SHLIB_PATH=/usr/lib:/path-to-tcl-lib

A quick-and-dirty fix for all such problems is this (again at the top of the script):
. /etc/profile
. /home/username/.profile

that gives the script a reasonable approximation to your interactive environment, regardless of whether run under cron or not.
nil illegitimi root-andum
Ninad_1
Honored Contributor

Re: sftp

I agree with the above reply.
What you need to do is in the script, move the SHLIB_PATH after the 4 ..._LIBRARY entries and add SHLIB_PATH=/quovadx/qdx5.2/integrator/clgui/java/lib/PA_RISC:/quovadx/qdx5.2/integrator/clgui/java/lib/PA_RISC/hotspot:/quovadx/qdx5.2/integrator/lib:/quovadx/qdx5.2/integrator/bin:/quovadx/qdx5.2/integrator/tcl/lib:/quovadx/qdx5.2/integrator/dbms/lib:/usr/lib:$TCLX_LIBRARY:$TCL_LIBRARY:$TIX_LIBRARY:$TKX_LIBRARY

This will add all the library paths to SHLIB_PATH .

Regards,
Ninad