From owner-freebsd-questions Sat Feb 22 8: 4:46 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A05937B401 for ; Sat, 22 Feb 2003 08:04:44 -0800 (PST) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 63CFB43F3F for ; Sat, 22 Feb 2003 08:04:42 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) by smtp.infracaninophile.co.uk (8.12.7/8.12.7) with ESMTP id h1MG4b5U005783 for ; Sat, 22 Feb 2003 16:04:37 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.7/8.12.7/Submit) id h1MG4bCL005782 for freebsd-questions@FreeBSD.ORG; Sat, 22 Feb 2003 16:04:37 GMT Date: Sat, 22 Feb 2003 16:04:37 +0000 From: Matthew Seaman To: freebsd-questions Subject: Re: fbsd backup 2 remote Message-ID: <20030222160437.GA5430@happy-idiot-talk.infracaninophi> Mail-Followup-To: Matthew Seaman , freebsd-questions References: <20030222145404.GA251@pooh.nagual.st> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030222145404.GA251@pooh.nagual.st> User-Agent: Mutt/1.5.3i X-Spam-Status: No, hits=-3.0 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_03_05, TO_LOCALPART_EQ_REAL,USER_AGENT,USER_AGENT_MUTT version=2.44 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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