Operating System - HP-UX
1820479 Members
2673 Online
109624 Solutions
New Discussion юеВ

How to FTP entire directories?

 
Joshua Goi
Frequent Advisor

How to FTP entire directories?

How to FTP entire directories? Is it possible in HP-UX?
15 REPLIES 15
steven Burgess_2
Honored Contributor

Re: How to FTP entire directories?

Just having a look now

initial thoughts would be to tar the dir and contents in an archive then get the tar file

The default message when trying to get a dir is

not a plain file

If you try mget it may traverse into the directory and give you the option of retrieving each file within the dir

HTH

Steve
take your time and think things through
Karthik S S
Honored Contributor

Re: How to FTP entire directories?

Try installing this package,

http://hpux.connect.org.uk/hppd/hpux/Networking/FTP/ftpcopy-0.3.5/

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Con O'Kelly
Honored Contributor

Re: How to FTP entire directories?

Hi

You could use the "mget *" command in ftp.

Example:

ftp> cd /dir
ftp> prompt
ftp> mget *

This will ftp all files (but not directories) in the current directory. The "prompt" command turns off interactive mode so you are not prompted for each file transfer. The "mget *" transfers all files.

Cheers
Con
Karthik S S
Honored Contributor

Re: How to FTP entire directories?

Hi Con,

I assumed that Joshua wants to ftp entire directory with sub directories. Does mget traverse thru sub-dirs???

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Con O'Kelly
Honored Contributor

Re: How to FTP entire directories?

Hi Karthik

You are correct, the standard ftp program on HP-UX cannot ftp directories. The mget will not traverse sub dirs.

The "mget" command is an option for Joshua if he only wanted to ftp a directories contents (excl sub dirs). As I said it will only ftp files not directories.
If you want to ftp directories and sub directories you'll need to install the package you suggested or use a tarball as Steven suggested.

Also most GUI based ftp programs can ftp directories (eg cute ftp).

Cheers
Con
Stuart Browne
Honored Contributor

Re: How to FTP entire directories?

You could always use something like the GNU 'ncftp' package, or the 'mirror' perl script (ftp://ftp.cs.columbia.edu/archives/perl/mirror/ (ok, so I just looked this up for someone else)).

One long-haired git at your service...
kenny chia
Regular Advisor

Re: How to FTP entire directories?

Hi
do a remote copy (rcp -rp )
All Your Bases Are Belong To Us!
Adisuria Wangsadinata_1
Honored Contributor

Re: How to FTP entire directories?

Hi there,

The easiest way to do this is to tar the directory into a file, then ftp the file.

For example:

# tar cvf {output file name} {directory name}

This will compact the whole directory into the file you name as output file name. Then you can ftp just that file.

When the file is received on the remote machine, the file will have to be un-tarred.

For example:

# tar xvf {file name}

Hope this information can help you.

Best Regards,
AW
now working, next not working ... that's unix
Brian Markus
Valued Contributor

Re: How to FTP entire directories?

I personally use ncftp. In my opinion it is one of the best ftp clients ever made. You can do ncftpd -R and it will transfer everything recursively. You can download the HP-UX package from the porting site:

http://gatekeep.cs.utah.edu/hppd/hpux/Networking/FTP/ncftp-3.1.4/


Good luck.

-Brian.
When a sys-admin say's maybe, they don't mean 'yes'!
Kong Kian Chay
Regular Advisor

Re: How to FTP entire directories?

If you are in X-Windows e.g login via CDE, how about using: xftp
(it comes with both our HP-UX 11.0 and 10.20). It works just like Windows WS-FTP.

If you are NOT in X-Windows e.g using dump terminal, you can only "tar" the subdir and then "ftp" the tar file.
KapilRaj
Honored Contributor

Re: How to FTP entire directories?

tar | rsh node1 tar xvf .,...

I have posted this some where else hence not typing it again ....

Kaps
Nothing is impossible
Karthik S S
Honored Contributor

Re: How to FTP entire directories?

It is funny that Joshua gives more points for responses with more lines rather than seeing the content of the response.

No points for this please ...

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Bruno Ganino
Honored Contributor

Re: How to FTP entire directories?

Go here and read, there are also software free download.

http://unix.about.com/cs/appsftp/

Look XFTP, it is useful ???
Regards

Bruno
Torino (Turin) +2H
Bill Hassell
Honored Contributor

Re: How to FTP entire directories?

Just a note about ftp. The standard for FTP is RFC 959 (http://www.faqs.org/rfcs/rfc959.html) and there is no recursion defined into lower directories. If you look at all the 'smart' ftp programs, they are simply designed internally to discover directories and traverse them as multiple ftp commands. So whether it is on a PC or Unix or a mainframe, transferring whole directory structures requires an automated ftp program.


Bill Hassell, sysadmin
Joshua Goi
Frequent Advisor

Re: How to FTP entire directories?

Hi all,

Thanks for the help rendered. I think the best way for me so far is to tar the directory and then ftp them. Thanks again everybody :)