From owner-freebsd-questions@FreeBSD.ORG Wed Aug 24 11:32:42 2005 Return-Path: X-Original-To: questions@freebsd.org 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 8232316A41F for ; Wed, 24 Aug 2005 11:32:42 +0000 (GMT) (envelope-from scott@fishballoon.org) Received: from mta09-winn.ispmail.ntl.com (mta09-winn.ispmail.ntl.com [81.103.221.49]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAAAD43D45 for ; Wed, 24 Aug 2005 11:32:41 +0000 (GMT) (envelope-from scott@fishballoon.org) Received: from aamta12-winn.ispmail.ntl.com ([81.103.221.35]) by mta09-winn.ispmail.ntl.com with ESMTP id <20050824113240.YTTA9239.mta09-winn.ispmail.ntl.com@aamta12-winn.ispmail.ntl.com>; Wed, 24 Aug 2005 12:32:40 +0100 Received: from llama.fishballoon.org ([81.104.195.171]) by aamta12-winn.ispmail.ntl.com with ESMTP id <20050824113240.BUZ29701.aamta12-winn.ispmail.ntl.com@llama.fishballoon.org>; Wed, 24 Aug 2005 12:32:40 +0100 Received: from scott by llama.fishballoon.org with local (Exim 4.52 (FreeBSD)) id 1E7tUk-000Hlt-3m; Wed, 24 Aug 2005 12:32:38 +0100 Date: Wed, 24 Aug 2005 12:32:38 +0100 From: Scott Mitchell To: Philip Hallstrom Message-ID: <20050824113237.GA68101@llama.fishballoon.org> References: <20050819141535.GA62513@lohi.local> <20050823182133.GF51748@ratchet.nebcorp.com> <20050823112716.U26292@wolf.pjkh.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050823112716.U26292@wolf.pjkh.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 4.11-RELEASE i386 Sender: Scott Mitchell Cc: Ilari Laitinen , Danny Howard , questions@freebsd.org Subject: Re: dump(8), incremental backups, Tower of Hanoi sequence, don't get it 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: Wed, 24 Aug 2005 11:32:42 -0000 On Tue, Aug 23, 2005 at 11:35:35AM -0700, Philip Hallstrom wrote: > >2) If all you have to deal with are static files and a > >not-super-giant-filesystem, use rsync. rsync -avz --delete once a night > >will "mirror" your data between drives or between machines without any > >trouble. The only disadvantage is there is no file retention if you > >want to restore a corrupt / deleted file after the fact. > > Actually there is... sort of... The trick is to use the --backup and > --backup-dir options: > > -b, --backup > With this option, preexisting destination files are renamed as each > file is transferred or deleted. You can control where the backup file > goes and what (if any) suffix gets appended using the --backup-dir and > --suffix options. > > --backup-dir=DIR > In combination with the --backup option, this tells rsync to store > all backups in the specified directory. This is very use- ful for > incremental backups. You can additionally specify a backup suffix > using the --suffix option (otherwise the files backed up in the > specified directory will keep their original filenames). Another useful rsync option is --link-dest: --link-dest=DIR This option behaves like --copy-dest, but unchanged files are hard linked from DIR to the destination directory. The files must be identical in all preserved attributes (e.g. permissions, possibly ownership) in order for the files to be linked together. I use this to rsync each backup into a new directory on the backup volume, named for the date of the backup. The result is a directory for each backup run, apparently containing every file from the source tree - but most of them are just hard links to some previous backup. This saves a *lot* of disk space as you only ever copy files that have changed since the last backup. You also have the complete file tree for each backup, so it's trivial to restore the version of a file that existed on any particular date. Cheers, Scott -- =========================================================================== Scott Mitchell | PGP Key ID | "Eagles may soar, but weasels Cambridge, England | 0x54B171B9 | don't get sucked into jet engines" scott at fishballoon.org | 0xAA775B8B | -- Anon