Remote Backup Using tar Over ssh

Bruce Marshall bmarsh
Sun Aug 7 19:34:33 PDT 2005


On Sunday 07 August 2005 06:12 pm, Kurt Wall wrote:
> 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

Maybe rsync?

rsync -auvzr  -e ssh  /old_web/   luther:/var/www/htdocs/old/


Note the trailing slashes.    Required.

Also good for incremental updates  by adding  --delete


More information about the Linux-users mailing list