copy folder to remote server

sunhux G sunhux at gmail.com
Tue Jul 22 01:17:22 UTC 2008


Hi,


>> # scp -r /tmp root at 10.6.40.80:/tmp/test

I used to use "rcp -rp ..."  but there's an issue with this
(& "scp -r ..." will probably has the same issue) :
the permissioning/ownership & timestamp of the
destination files may not be the same as in the source
despite that "p" (preserve) option is there.

So I used :
tar cvf - . | rsh remote_host 'cd /tmp/test; tar xvf -'
which retains the timestamp/permissioning.

Anyone wants to try with "tar" & "scp"?
tar zcvf -  /usr/local/apache/htdocs | ssh root at 1.2.3.4 "cat >
/var/www/html/htdocs.tar.gz"



More information about the redhat-list mailing list