From owner-freebsd-questions@FreeBSD.ORG Mon Dec 29 08:22:57 2003 Return-Path: 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 73DF716A4CE for ; Mon, 29 Dec 2003 08:22:57 -0800 (PST) Received: from anon.securenym.net (anon.securenym.net [209.113.101.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 42D7643D41 for ; Mon, 29 Dec 2003 08:22:54 -0800 (PST) (envelope-from dincht@securenym.net) Received: (from root@localhost) by anon.securenym.net (8.11.7/8.11.7) id hBTGJdt22787 for freebsd-questions@freebsd.org.filtered; Mon, 29 Dec 2003 10:19:39 -0600 (CST) Message-Id: <200312291619.hBTGJdt22787@anon.securenym.net> X-Securenym: dincht From: "C. Ulrich" To: Joachim Dagerot In-Reply-To: <200312290935.hBT9Zo423698@thunder.trej.net> References: <200312290935.hBT9Zo423698@thunder.trej.net> Content-Type: text/plain Organization: The Peter Jennings Fan Club Mime-Version: 1.0 Date: Mon, 29 Dec 2003 11:14:14 -0500 Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: Incremental backup solution. was: What logs etc do I need tocheckfrequently? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2003 16:22:57 -0000 On Mon, 2003-12-29 at 04:35, Joachim Dagerot wrote: > This solution sounds nice, I can even imagine setting up an additional > machine (on the same location though) to have a somewhat galvanic > isolation between the disks. Only fire, earthquake and a neutronbomb > would affect such a backup solution. > > However, I could use a push in the right direction when it comes to > how to configure and what software to use for achieving the > incremental backup tasks. > > Could you hint me in how your system is doing this in a more detailed > way? > > Cheers, > Joachim I'd be glad to. First, it's actually a Linux system, though there's nothing particularly Linux-specific about it except the device names and the method of spinning down the backup disk after the job. The cornerstone of the solution is the rdiff-backup program (http://rdiff-backup.stanford.edu/ or in ports at /sysutils/rdiff-backup). rdiff-backup is a python script that mirrors one directory to another. It can do incremental backups and it can do them either locally or remotely. It's really a slick piece of software and I'm continually surprised that it doesn't get more publicity. First, there's the (trivial) script /usr/local/sbin/backup-share.sh. This is run by a daily cron job to backup directories on the disk that contain Important Data. Mine is very specific to my system. It is *not* pretty and I plan to overhaul it sometime soon to include error handling and an external config file. #!/bin/bash # script to automatically back up the important stuff on /nfs/share prog=/usr/local/bin/rdiff-backup src=/nfs/share dst=/backup/share budirs="code emu images media music school software text webpage" mount /backup for dir in $budirs do $prog $src/$dir $dst/$dir done umount /backup # put backup drive in sleep mode since we won't be needing # it again for the next 24 hours or so hdparm -qY /dev/hdd A note about the last line: it appears that FreeBSD can only spin-down SCSI disks on command. (See camcontrol(8).) The best way to power down IDE disks seems to be just setting a suspend timeout in the power management section of your BIOS. Once the disk is unmounted, FreeBSD won't touch it thereafter and the system should put it in suspend mode automatically. The crontab entry looks like this: # backup selected dirs in /nfs/share @ 0730 daily 30 07 * * * sh /usr/local/sbin/backup-share.sh That's really about it. Like I said before, moving the backup disk to a separate machine would be trivial. If there are any questions, I'd be glad to answer them. Charles Ulrich -- http://bityard.net