[CentOS] remote tar via ssh

Les Mikesell lesmikesell at gmail.com
Wed Sep 26 19:33:30 UTC 2007

ann kok wrote:
> can you tell me what is the exactly command?
> machineA# ssh root at nachineB:tar cvf / ; tar xvf *

You need a - after the f options to represent stdin/stdout and some 
appropriate quoting.

ssh root at machineB 'tar cvf - /' |tar xvf -

(and you probably want to use --one-file-system or some excludes to 
avoid /proc and any NFS/cdrom mounts).

But, I'd recommend:
  rsync -essh machineB:/ .
instead (also per filesystem with --one-file-system) - especially if you 
want to repeat it or restart after interruption.

   Les Mikeselll
    lesmikesell at gmail.com

More information about the CentOS mailing list