Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Feb 2003 16:04:37 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: fbsd backup 2 remote
Message-ID:  <20030222160437.GA5430@happy-idiot-talk.infracaninophi>
In-Reply-To: <20030222145404.GA251@pooh.nagual.st>
References:  <20030222145404.GA251@pooh.nagual.st>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 22, 2003 at 03:54:04PM +0100, Dick Hoogendijk wrote:
> I want to make a *full* backup of my fbsd-4.7 to a (remote) HD on my
> local network.
> 
> Should I share the (remote) directory through NFS or an alternate way.
> And most important: what program do I use. The remote is an ext3 linux
> drive.
> 
> Can anyone point me in the right (syntax) direction?
> Should I use tar? Or what?
> In future I want to be able to do a full restore to a new (and much
> larger) harddrive ;-))

There's two parts to this:  

    What program should you use to generate images of your file
    system?

    How do you save the data onto your remote machine?

The first question is easy enough to answer.  Any sort of backup
software will do what you want, so long as it can write it's output to
stdout.  dump(8) will give you the most faithful recreation of your
filesystem on the new drive, but tar(1) will work fine if your
filesystem just contains regular files, directories and links.  Use
whichever suits you best.  If you use dump(8) (and probably if you use
tar(1)), you'll have to backup each partition on the disk in turn,
rather than trying to do the whole disk in one shot.

The trick is in the answer to the second question.  Use ssh to let you
write the backup to the remote system.  Just run your backup command
of choice and direct the to stdout, which you then pipe into ssh(1):

    # dump -0f - /usr | ssh linuxbox "cat > /foo/fbsd-usr.dump"

or

    # cd /home ; tar -jcvlf - . | ssh linuxbox "cat > /foo/fbsd-home.tar.bz2"


Doing the restore is much the same thing in reverse:

    # cd /usr ; ssh linuxbox "cat /foo/fbsd-usr.dump" | restore -rf -

or

    # cd /home ; ssh linuxbox "cat /foo/fbsd-home.tar.bz2" | tar -jxpvf - 


Nb.  You might think from reading the appropriate man pages that you
could dump directly to a remote file or write a tar file onto a remote
machine by using a construction like:

    # dump -0f linuxbox:/foo/root-fbsd.dump /

or 

    # tar -jcvf linuxbox:/foo/root-fbsd.tar.bz2 /

This is certainly possible, but it requires use of the rmt(8) program
via rexec(3) or rcmd(3) -- or in other words, rsh(1).  That's best
avoided unless you're very sure you can deal with the security
implications.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030222160437.GA5430>