Remote Backup Using tar Over ssh

Kurt Wall kwall
Sun Aug 7 16:25:26 PDT 2005


Hello, list,

I needed to move a directory tree from one machine to another on my 
local network. Interested in doing so in as few steps as possible,
I found a tar over ssh invocation worked quite handily:

tar cf - /old_web | ssh root at luther tar xf - /var/www/htdocs/old

This creates  a tar archive of /old_web, sending the created
output to stdout. The output is piped to the stdin of a tar 
command invoked over ssh, which deposits the output into
/var/www/htdocs/old on the destination machine (luther).

I'm sure there are more elegant ways to do this, but IWFM.

As always, YMMV and if it breaks, you get to keep both pieces.

Kurt
-- 
Most people can't understand how others can blow their noses differently
than they do.
		-- Turgenev


More information about the Linux-users mailing list