dump(8), incremental backups, Tower of Hanoi sequence, don't get it

Scott Mitchell scott+lists.freebsd at fishballoon.org
Wed Aug 24 11:32:42 GMT 2005

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:

      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

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.



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

More information about the freebsd-questions mailing list