cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to connect to FTP server from Shell Script : FTP command not found

Former Member
0 Kudos

hi Experts,

we are using the following shell script in sender file channel, option "Run operating system command before message processing " to connect to a remote FTP server to pick a specific file.

In sender channel , we giving the path as /files/PI/100/Test/file.sh

#!/bin/sh
var="abc_20120803"
HOST="A"
USER="B"
PASSD="C"
ftp -n $HOST << END_SCRIPT >

user $USER $PASSD

cd /root
lcd /files/PI/100/Test/
mget $var.xml
bye
END_SCRIPT

We are unable to copy the file to local PI directory.Even when we tried by using echo command to get the log .we are getting error as

"files/PI/100/Test line 6: ftp: command not found"

please suggest me.

Thanks

Dhileep

Accepted Solutions (0)

Answers (3)

Answers (3)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

This might be due to two reasons.. Your script does not run the ftp using the right path or ftp service (program) is currently not installed in the OS.  Please work with system admins.

former_member191911
Contributor
0 Kudos

Think you need to put the path of the ftp binary in front of the command.

So /usr/bin/ftp instead of only ftp.

To find the location where your ftp binary is stored, you can execute the command: whereis ftp

Kind regards,

Mark

Former Member
0 Kudos

Does it behave the same when you run the script from terminal window?

There must be a reason you are using the standard PI FTP adapter to handle it?