From owner-freebsd-questions@FreeBSD.ORG Thu Oct 15 06:42:22 2009 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A9D1106566B for ; Thu, 15 Oct 2009 06:42:22 +0000 (UTC) (envelope-from steve@ibctech.ca) Received: from smtp.ibctech.ca (v6.ibctech.ca [IPv6:2607:f118::b6]) by mx1.freebsd.org (Postfix) with SMTP id 9F8B08FC08 for ; Thu, 15 Oct 2009 06:42:21 +0000 (UTC) Received: (qmail 15806 invoked by uid 89); 15 Oct 2009 06:42:50 -0000 Received: from unknown (HELO ?IPv6:2607:f118::5?) (steve@ibctech.ca@2607:f118::5) by 2607:f118::b6 with ESMTPA; 15 Oct 2009 06:42:50 -0000 Message-ID: <4AD6C463.40307@ibctech.ca> Date: Thu, 15 Oct 2009 02:42:43 -0400 From: Steve Bertrand User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Nerius Landys References: <560f92640910142042tc46f1e3lb81ac1e4528a44ab@mail.gmail.com> In-Reply-To: <560f92640910142042tc46f1e3lb81ac1e4528a44ab@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: questions@freebsd.org Subject: Re: Best procedure for full backup of live system X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2009 06:42:22 -0000 Nerius Landys wrote: > My server is increasingly having important work stored on it, and I > need to start taking backups of a lot of directories, especially > /home, /opt, /etc, /usr/local/etc, and maybe others. The ideal backup > (and what I've done in the past) is to take a full low-level dd image > of the disk while the system is down (this is easy to do in a > situation where you have dual boot). ...but you've found recently that it isn't scalable. > Or, since the output of dd would > take up tons of space and would only be usable on an identical hard > drive, use "dump" to take the backup while the machine is turned off > (again easy to do on a dual boot). But now, I cannot bring down the > machine. My plan is to do a tar gzip of / on the fly, and pipe that > to ssh (remote machine). However, the system is live, and files will > be in the progress of changing. ...quick hack, tested example ( recommended for a quick fix only. do a proper archive ) %pwd /home/steve %mkdir arch && ls | grep arch arch %echo "blah, blah" >> arch/file.txt %cat !$ cat arch/file.txt blah, blah # now, even though this is a ~ example, I use / all the time... tarball /home/steve/arch directory ( and contents ) to a different server: %tar -cvzf - arch | ssh steve@amanda.eagle.ca ' cat > arch_test.tar.gz' a arch a arch/file.txt ... after key-auth ( or password auth ) to remote SSH server, on the remote server: %pwd /usr/home/steve %ll | grep arch -rw-r--r-- 1 steve steve 10240 Oct 15 02:16 arch_test.tar.gz %pwd /usr/home/steve %mkdir restore-test %mv arch_test.tar.gz restore-test/ %cd !$ cd restore-test/ %tar -xzvf arch_test.tar.gz x arch/ x arch/file.txt %cd arch %ll total 1 -rw-r--r-- 1 steve steve 11 Oct 15 02:17 file.txt ... booya, restored, on a remote server...look: %cat file.txt blah, blah ...Just like that! If I've missed something, forgive me. I swear that doing a 'backup' to a remote location with a FreeBSD box is honestly *nearly* as easy to this Canadian as packing snow into an iceball to hit the bus with ;) Steve