1754904 Members
3470 Online
108827 Solutions
New Discussion юеВ

Help on ftp script????

 
SOLVED
Go to solution
gobi_1
Frequent Advisor

Help on ftp script????

How to get group of files directly from the old UX to new UX machine without confirmation of files to transfer? Can anyone share me a sample ftp script? thanks
7 REPLIES 7
Ganesan R
Honored Contributor
Solution

Re: Help on ftp script????

Hi,

You should use ftp commands "prompt" and "mget" in the ftp prompt.

prompt will on/off the user prompt for every file transfer.

mget is to get pattern of files in single shot.
Best wishes,

Ganesh.
Dennis Handly
Acclaimed Contributor

Re: Help on ftp script????

If you have a large bunch of files you may want to tar them up so you can maintain permissions, ownership and dates.
gobi_1
Frequent Advisor

Re: Help on ftp script????

thanks sir for both reply, mget works & may also consider tar for preserving permission.

but can you give a sample script to fully automate the ftp process?

and a sample script also to transfer backup files from unix to Windows?

thanks
James R. Ferguson
Acclaimed Contributor

Re: Help on ftp script????

Hi:

> but can you give a sample script to fully automate the ftp process?

Simply search this forum. You will be amply rewarded.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: Help on ftp script????

Shalom,

Did the search for you.

ftp -n << ENDFTP
user
prompt
ascii
lcd
cd
mget *
ENDFTP
# adjust commands to your need.
Much better however is scp -p with public key exchange.

http://www.hpux.ws/?p=10

SEP

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mel Burslan
Honored Contributor

Re: Help on ftp script????

ftp -v -i -n ip_address_or_hostname_here <user myusername mypassword
bin
cd /some/directory
mget *some_pattern*
bye
EOF

replace username password and some_pattern according to your requirements

Hope this helps.
________________________________
UNIX because I majored in cryptology...
gobi_1
Frequent Advisor

Re: Help on ftp script????

thanks steven & james for all the helped.