Operating System - HP-UX
1834459 Members
2428 Online
110067 Solutions
New Discussion

moving folders and files in it to diff server thro ftp?

 
pavanns
New Member

moving folders and files in it to diff server thro ftp?

Hi can we move all the folders and sub folders and files in it into a remote server thro ftp connection. This is on Unix platform.
7 REPLIES 7
Steven Schweda
Honored Contributor

Re: moving folders and files in it to diff server thro ftp?

Many ways, depending on the details.

The best way is probably to use "tar" or
"pax" or Zip, or something similar, to bundle
everything into one (compressed) package,
then transfer that, and finally unpack it at
the other end.

If you have only FTP access, and you're
fetching things, then something like wget can
do recursive FTP fetch operations.

http://www.gnu.org/software/wget/wget.html

If you have only FTP access, and you're
sending things to the server, then you'll
need to wait for better suggestions.
Dennis Handly
Acclaimed Contributor

Re: moving folders and files in it to diff server thro ftp?

>Steven: If you have only FTP access, and you're sending things to the server, then you'll need to wait for better suggestions.

You can use mput to send files.
It will skip directories with an error:
XXX: not a plain file.

If you can't use Steven's suggestion of tar,
you'll need to create a script to generate ftp input. Combinations of mput, mkdir, lcd and cd to walk the directory subtree.
Steven Schweda
Honored Contributor

Re: moving folders and files in it to diff server thro ftp?

> You can use mput to send files.

There is also a program called wput, at which
I looked long ago, which was intended to work
like wget backward. (VMS has COPY /FTP, so I
never used wput much.)

http://sourceforge.net/projects/wput/

It may be good or not. I don't know.
Dave La Mar
Honored Contributor

Re: moving folders and files in it to diff server thro ftp?

You do not say what the receiving server is, so we can only assume the host and target are both unix.
In that case, tar is a good weapon of choice as it will maintain and recreate directory structures.
Rememeber, in unix, there are no folders, only files. The tar command will rebuild the structure as you expect.
Once you have the tar file, FTP "put" it in BINARY mode to the receiving machine or, from the receiving machine, ftp to the host machine and "get" the file in BINARY mode.

Regards,

-dl
"I'm not dumb. I just have a command of thoroughly useless information."
Steven Schweda
Honored Contributor

Re: moving folders and files in it to diff server thro ftp?

> [...] we can only assume [...]

Perhaps _you_ can only assume that. _I_ can
assume anything I wish. Or not.

> [...] in unix, there are no folders, only
> files. [...]

Don't you get saddle sores from riding that
old hobby-horse? When someone says "folder",
perhaps you could translate it (internally)
to "directory". Or do you claim that UNIX
doesn't have directories, either? (If so,
you should start complaining about the "man"
pages, not about some poor fellow's use of a
perfectly clear and meaningful term.)
yulianto piyut
Valued Contributor

Re: moving folders and files in it to diff server thro ftp?

you can not transfer all the folders and sub folders and files via ftp. If you want it, you can try to use rsync or scp.


-yut-
Steven Schweda
Honored Contributor

Re: moving folders and files in it to diff server thro ftp?

> you can not transfer all [...]

There's a difference between "I don't know
how to" and "You can not".

If it's possible to transfer one file, then
it's possible to transfer all the files.
More than one FTP command may be needed, but
that's a long way from "you can not". (Well,
perhaps _you_ can not, but that's a long way
from "_I_ can not" or "anyone else can not".)