Using ftp to transfer files in batch mode


bash-3.2$ uname -a
SunOS bakudbtstora1 5.10 Generic_150400-11 sun4v sparc sun4v
bash-3.2$ ftp -inv <<-EOD
> open bakudbtstora1
> user oracle ora123
> cd ftproot
> binary
> mput test*.txt
> bye
> EOD
Connected to localhost.
220 vmx01 FTP server ready.
331 Password required for oracle.
230 User oracle logged in.
250 CWD command successful.
200 Type set to I.
200 PORT command successful.
150 Opening BINARY mode data connection for testa.txt.
226 Transfer complete.
200 PORT command successful.
150 Opening BINARY mode data connection for testb.txt.
226 Transfer complete.
200 PORT command successful.
150 Opening BINARY mode data connection for testc.txt.
226 Transfer complete.
200 PORT command successful.
150 Opening BINARY mode data connection for testd.txt.
226 Transfer complete.
221-You have transferred 0 bytes in 4 files.
221-Total traffic for this session was 845 bytes in 4 transfers.
221-Thank you for using the FTP service on vmx01.
221 Goodbye.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: