Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ftp a file

Status
Not open for further replies.

runa12345

IS-IT--Management
Jul 13, 2006
9
0
0
US
Hi All,
I have to ftp a file from a server to other server(which is mainframes). I have script which is written already and used for other ftp's.
----------------------------------------------------
Here is the script:

----------------------------
remote_server="${1}"
remote_user="${2}"
remote_passwd="${3}"
remote_path="${4}"
remote_file="${5}"
local_path="${6}"
local_file="${7}"
log_path="${8}"

ftp -v -n $remote_server << eof >> $log_path/$local_file.log
user "$remote_user" "$remote_passwd"
lcd $local_path
cd $remote_path
prompt
put $local_file $remote_file
eof
------------------------------------------------
Values of the variables are passed through other processes
=============================================
remote_server="greta"
remote_user="group"
remote_passwd="apple"
remote_path=
remote_file="12345"
local_path="/usr/fact/rin/"
local_file="abcd.txt"
log_path="/usr/fact/log"
=================================================

This script looks good and works fine. But my problem is I am not able to ftp a file.It shows me the error:

abcd.txt: A file or directory in the path name does not exist

where I am able to ftp a file manually to this particular server. Any kind help is greatfull.

Thank you...
 
Hi

First of all I would check if /usr/fact/log/abcd.txt is writable for that user.

Then I would try the same script without redirecting its output.

Maybe is different on Unix, but on Linux the log files usually are stored in the /var/log directory. So the /usr directory could be [tt]mount[/tt]ed read-only.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top