Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy an entire directory from a remote server?

Status
Not open for further replies.

Cadwalader

IS-IT--Management
Feb 12, 2002
297
US
Hello again,

I need to copy an entire directory from a remote server. It's an Apache server, that is showing directories. Would I use grep? I've used that for individual files, but not for a dir, and when I just do #grep I get squat. The bash goes away like it's doing something, but even with -v, it doesn't do anything but look like it's doing something. I let this go on for about 15 minutes.


The stuff I am after is Linux server tutorials so that means soon I won't be bugging you good folks so much. :)

Hope I was of some help...
--OR--
Thanks for the help...
--Rich
 
Why not try "find" instead, or even "ls".

e.g. find </your/initial/dirname> -d <your_cp_dirname> exec cp {} \;

Not sure how you want to copy from a URL though, that's new to me. IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
 
Correction to the above, hope I got it right this time:
find </your/initial/dirname> -type d <your_cp_dirname> exec cp {} \;
IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
 
My choice is

#cd /source_dir
#find . | cpio -o | rsh remote_system &quot;cd /dest_dir ; cpio -idmuv&quot;

This will copy entire dir to remote system with recursion and preserves permission and ownership.

Patel
 
If your servers are running OpenSSH, then you can try the 'scp' (secure copy) command.

scp -r root@host1:/some_dir /path_on_local_machine

ChrisP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top