Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jan 1996 19:55:04 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        wjh@bhoss.ifx.net
Cc:        questions@freebsd.org
Subject:   Re: Tar backup to another machine ?
Message-ID:  <199601050255.TAA01089@phaeton.artisoft.com>
In-Reply-To: <XFMail.960104191550.wjh@bhoss.ifx.net> from "Bill Henderson" at Jan 4, 96 07:15:50 pm

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
> Can someone help me with the syntax for running tar on one machine outputing
> the file on the other?

1)	Archive local files to a device on a remote machine:

	tar cvf - <local files> | rsh <remote box> dd of=<remote dev>

2)	Extract files from a device on a remote machine to the local
	machine:

	rsh <remote box> dd if=<remote dev> | tar xvf -

3)	Archive remote files to a device on a local machine:

	rsh <remote box> tar cvf - <remote files> | dd of=<local dev>

4)	Extract files from a local device to a remote machine:

	dd if=<local dev> | rsh <remote box> tar xvf -


You may change the directory on the remote machine before the archival
or extraction if you use the rich shell escape sequence for your account
on the remote machine.  For instance, if your shell on the remote machine
is the Bourne shell (/bin/sh), you can extract the files into the /tmp
directory (assuming they are relative pathed), by changing #4 above to:

	dd if=<local dev> | rsh <remote box> "( cd /tmp ; tar xvf -)"

The same will work for changing the directory before archiving files from
the remote machine.


You would probably be better off using the "Amanda" port in "packages"
if your intent is to perform remote backups.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?199601050255.TAA01089>