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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automate ftp from Windows 2000 to Unix server

Status
Not open for further replies.

joephilip

MIS
Apr 29, 2002
41
US
I am developing a system to ftp some files from our Windows 2000 server to Unix.

I have an enironment varaible set at my windows side like this:

set DEST_DIR=/home/oracle/scripts

If I want to call that variable into the script like cd $DEST_DIR- how do I do this?

I put all my ftp commands in a file called ftp.cmd and call the ftp like this from the Command prompt:

ftp -s:ftp.cmd servername

---------------------
ftp.cmd file look like this:


oracle
passed
cd $DEST_DIR ----- what is the windows qequivalent of this command?
put myfile.sql
y
close
quit
EOF
----------------------------

 
You can try something like this:
Code:
cd %DEST_DIR%
ftp -s:ftp.cmd servername
and remove the cd line in your
Code:
ftp.cmd
file.

Hope This Help
PH.
 
or put the resolved value of $DEST_DIR variable in your ftp.cmd:

btw, why do you have 'command?' there?

#---------- ftp.cmd
oracle
passed
cd /home/oracle/scripts
command?
put myfile.sql
y
close
quit

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top