Re: remote tar via ssh

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



On Wed, Sep 26, 2007 at 03:22:02PM -0400, Von Landfried wrote:
> I copied this from <http://happygiraffe.net/copy-net> which is a nice  

> tar -cf - /some/file | ssh host.name tar -xf - -C /some/place/cool

Do not use "/some/file"  - Although GNUtar (the version on CentOS) will
strip off the leading / on extraction, it's a bad habit to get into
and _will_ bite you in the foot if you ever use a different version of tar.

Also, depending, a "p" flag on extraction might be useful.

Personally I also "cd" rather than -C on extraction.  So

  cd /source/directory
  tar cf - . | ssh RemoteHost "cd /dest/directory && tar xfp - "

-- 

rgds
Stephen
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux