copying files

Hi,

Is it possible to ftp total directory and its subdirectories from one system to other and is it possible to 'rcp' directories and its subdirectories to other systems. If possible, can you please let me know how to do this.

Thanks,

Sreeram.
sreeramreddyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jlevieCommented:
Yes, it's possible to copy directories with ftp, but you have to have a client that supports recursive gets/puts. NcFTP (www.ncftp.com) is a command line utility that can do it, also wget can be used for recursive copies and I imagine that there are others.

As far as I know rcp can't do recursive copies, at least I've never encounterd an rcp implementation that could. You can use tar and rsh to move directory trees between systems, as in:

tar cf - some-dir | rsh remote-sys tar xf -
0
kotamrajuCommented:
Sreeram:
you can do that using an -r option with rcp.  -r option will copy all the subtrees under the directory.  But make sure that you have the same login/password  on both the systems and also check whether you made an entry in .netrc file.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jlevieCommented:
jlevie changed the proposed answer to a comment
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

sreeramreddyAuthor Commented:
Hi,

can you please tell me what entry should be there in .netrc file and where can I find this file on Solaris system.


Thanks,


Sreeram.
0
kotamrajuCommented:
Sreeram:
I'm not very sure about the solaris system but it should present in your home directory.  If its not found then create a file using vi command.

the contents of the file should be
machine <systemname or ip address> login <login name> password <password>.

These files should present on both the systems.
0
tfewsterCommented:
Actually, it's the .rhosts file you need to set up for rcp/rsh/rlogin: Make sure the system you are copying FROM has a .rhosts file in your home directory there. The file should contain the hostname of the system you are initiating the rcp on.  

..netrc MUST be readable by the owner only, or FTP will refuse to use it (a security measure against people leaving passwords lying around where anyone can see them). I have only ever seen .netrc used as an FTP "script", e.g.
machine foo login tim password in_your_dreams
get filename
get another_filename
..
..
..


Basically, .rhosts tells the server which remote systems are "trusted" to allow remote commands to be run.
(man rhosts / man netrc for more info. on the format & uses of the files)

0
sreeramreddyAuthor Commented:
Hi,

rcp -r is working fine with out modifying or creating any .xx files, only thing is I have to type password every time.

Thanks,

Sreeram
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.