Operating System - HP-UX
1827286 Members
1692 Online
109717 Solutions
New Discussion

FTP can use a command file to transfer data?

 
SOLVED
Go to solution
Stanley_8
Advisor

FTP can use a command file to transfer data?

FTP can use a command file(include many commands) to transfer data?
3 REPLIES 3
V.Tamilvanan
Honored Contributor
Solution

Re: FTP can use a command file to transfer data?

Hi ,
U can put all the commands into a file and execute.
Example
Ftp Script:-
ftp -i -n -v Server1 << EOF
user unix unix
lcd /abc
cd /usr
put filename
bye
EOF



-hth
steven Burgess_2
Honored Contributor

Re: FTP can use a command file to transfer data?

Hi

Do you mean send a list of files to send as defined in a file

if so

for file in $(cat )
do
ftp -inv <open
user
cd
mput $file
bye
EOF
done

HTH

Steve
take your time and think things through
Geoff Wild
Honored Contributor

Re: FTP can use a command file to transfer data?

Well - you can script it:

If you have a .netrc file:

ftp -v "remote-machine" << EOF
bin
put "file"
put "file1"
bye
EOF

No .netrc:

ftp -v "remote-machine" << EOF
user
prompt
bin
put "file"
put "file1"
bye
EOF

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.