Re: copy folder to remote server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, Jul 21st 2008 at 10:07 -0000, quoth Mad Unix:

=><redhat-list@xxxxxxxxxx>
=>Message-ID:
=>	<4d3f56c90807210707v54ab0f17rfd1b88069ad40dde@xxxxxxxxxxxxxx>
=>Content-Type: text/plain; charset=UTF-8
=>
=>I want to copy all the following files/folder/subfolders under
=>/usr/local/apache/htdocs to a remote server within this directory
=>/var/www/html/
=>Am I correct with this command, or far away offff
=>
=>tar zcvf -  /usr/local/apache/htdocs | ssh root@xxxxxxx "cat >
=>/var/www/html/htdocs.tar.gz"

That won't work because all you'd end up with is a transfer of the tar.gz
file. It will not have been unpacked. You probably intend something like


cd /usr/local/apache
tar -zcvf htdocs | ssh root@xxxxxxx "cd /var/www/html; tar -zxf -"

Of course, scp -r will probably also work too. ;-)

And for the people who do it right in the first place...

find htdocs -print | cpio -o | \
ssh root@xxxxxxx 'cd /var/www/html; cpio -idvum'


--
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux