Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Aug 2005 12:32:38 +0100
From:      Scott Mitchell <scott+lists.freebsd@fishballoon.org>
To:        Philip Hallstrom <freebsd@philip.pjkh.com>
Cc:        Ilari Laitinen <ilari.laitinen@iki.fi>, Danny Howard <dannyman@toldme.com>, questions@freebsd.org
Subject:   Re: dump(8), incremental backups, Tower of Hanoi sequence, don't get it
Message-ID:  <20050824113237.GA68101@llama.fishballoon.org>
In-Reply-To: <20050823112716.U26292@wolf.pjkh.com>
References:  <20050819141535.GA62513@lohi.local> <20050823182133.GF51748@ratchet.nebcorp.com> <20050823112716.U26292@wolf.pjkh.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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