Operating System - HP-UX
1834492 Members
3512 Online
110067 Solutions
New Discussion

Re: ftp to transfer directorys

 
kamal vithanage
Contributor

ftp to transfer directorys

Hi all,
How do you use ftp to transfer directorys

Thk

kamal
11 REPLIES 11
Vincenzo Restuccia
Honored Contributor

Re: ftp to transfer directorys

tar cvf ftp.tar /directory/*,gzip ftp.tar,
ftp of gzip.tar.z.
Manuel Plaza
Regular Advisor

Re: ftp to transfer directorys

Hi Kamal,

You can to install a graphic ftp "xftp" that you can find in: http://hpux.connect.org.uk/.

Regards

Manuel
Paula J Frazer-Campbell
Honored Contributor

Re: ftp to transfer directorys

Hi
Ftp does not have a recursive switch and so ftp itself cannot do directories with out a cd to each directory in turn.

As previously suggested use tar - ftp the tar file accross and then untar it on the destination machine.



HTH

Paula
If you can spell SysAdmin then you is one - anon
f. halili
Trusted Contributor

Re: ftp to transfer directorys

I agree ..... ftp does not handle entire directories.
You may tar, compress, then ftp to the otherbox.

-fnhalili
derekh
Shannon Petry
Honored Contributor

Re: ftp to transfer directorys

Even with Programs that seem to do recursive, they don't work in such a way. Those programs make lists of directories, and files, and create directories and put eaches content separetly. Same for getting directories and contents.

If you are creative enough, you could script something to handle the putting of multiples. Getting multiples would work similarly, but be much more difficult.

Regards,
Shannon
Microsoft. When do you want a virus today?
Steffi Jones_1
Esteemed Contributor

Re: ftp to transfer directorys

Hi,

I have used xftp in the past for transferring directories with quiet a lot of subdirectories and it always worked to my satisfaction.

I would give it a shot.
Anything else involves more work like tar first and then ftp, but that of course is a doable and fairly easy procedure.

Take care,
Steffi Jones
Fred Martin_1
Valued Contributor

Re: ftp to transfer directorys

I suppose this is a lot like using tar, but I often use cpio to do the same thing:

# find /opt/fab | cpio -ocuvB > tempfile
# ftp hostname
ftp> binary
ftp> put tempfile

Then on the other machine, do a cpio to restore the files. Be careful about relative or absolute pathnames and all that, and the file system holding tempfile (on both machines) must be large enough to hold the file.
fmartin@applicatorssales.com
Brian Markus
Valued Contributor

Re: ftp to transfer directorys

I grabbed a program called ncftp It's used at the command prompt or in a gui mode. It's just like useing regular ftp, but you can use a -R for recursive.

mget -R /bigdir

http://www.ncftp.com/ncftp/

Hope that helps,

Brian

When a sys-admin say's maybe, they don't mean 'yes'!
KVG
Esteemed Contributor

Re: ftp to transfer directorys

try something like this:
for DIR in dir1 dir2
do
for file in `ls $DIR`
do
ftp -n -v <
Jim Moffitt_1
Valued Contributor

Re: ftp to transfer directorys

kamal,
I would do a tar like vincenzo said with tar and either ftp it over or even rcp it over. Tar will definitely keep the directory structure in tact which is what I think you want.
Herve BRANGIER
Respected Contributor

Re: ftp to transfer directorys

Hi,

Another method is to change your ftpd deamon.
If you can install a powerfull deamon like
wu-ftpd ( http://hpux.cict.fr/hppd/hpux/Networking/FTP/wu_ftpd-2.6.1/) you can use compression before
transfer by example :

you want all the directory /pub/hp-ux

cd /pub
get hp-ux.tar.z

Before to send you data, server tar and
compress all of them.

If you can't change your deamon I think you
can configure it to use users ports (>1024).

Regards,

Herve