Re: continuous backup solution for FreeBSD



Evren Yurtesen wrote:
Shaun Amott wrote:
On Tue, Oct 07, 2008 at 12:31:58AM +0300, Evren Yurtesen wrote:
so FreeBSD could be supported also. As you can imagine, it is not only
important that data can be restored when a box hardware failure etc. it is
also important that data can be restored if deleted by accidents etc. While
traditional backup programs provide this functionality, you cant really go
back to 10 min or 1h ago, often they take daily backups and have to scan
whole filesystem for changed files every time the backup is taken which
stresses out the systems.

This can (more or less) be achieved with snapshots: you can cheaply
maintain old versions of the file system, and mount an old snapshot at
any time. Hourly is about as fine-grained as you can expect though.

The documentation says one cant do more than 20 snapshots.
http://www.freebsd.org/doc/en/books/handbook/snapshots.html

I wouldn't use UFS snapshots for this purpose. They have
a few well-known disadvantages.

However, ZFS snapshots should work very well for this.
They're not limited to 20, and you can create them very
quickly and with low overhead. You could create a new
snapshot every 5 minutes if you want.

Then you can use the "zfs send" command to produce a
stream that contains the incremental differences between
the snapshot and the previous snapshot, i.e. the stream
represents the changes to the filesystem within the past
five minutes (or whatever snapshot interval you choose).

You can store that stream in a file, on backup medium,
or send it with ssh to a different continent. Every once
in a while you should make a full backup from a snapshot,
of course.

Basically it works like any other incremental backup
mechanism, except that you can make the time interval
between incremental backups very small (like five minutes
in the above example), so you get a nearly continous
backup solution.

By the way, if you accidentally deleted something, you
can of course simply copy it back from a snapshot. You
can even revert the whole file system to a previous
snapshot using the "zfs rollback" command. This is
like going back in time. There is no need to touch
your backups for that.

These features are readily available right now on FreeBSD.
You don't have to code anything.

Best regards
Oliver

--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd

"UNIX was not designed to stop you from doing stupid things,
because that would also stop you from doing clever things."
-- Doug Gwyn
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Volume Shadow Copy on XP/2K3
    ... Most modern 3rd party backup software are VSS requestors - like, say, Veritas ... which involve the data storage of aforementioned database software. ... This means that the snapshot can possibly contain non-integral in-transition ...
    (comp.arch.storage)
  • Re: RAID gotchas!
    ... will keep my backup up-to-date). ... # 3) Create a FS snapshot using LVM ... # 6) rsync the differences between the snapshot FS and the backup FS ... cleanup; continue;} ...
    (Fedora)
  • Re: Klonen vs. Backup
    ... "Interressant" an dem Artikel fand ich, dass eben dieser alter Hut jetzt ... Snapshots haben erstmal *nichts* mit Backup zu tun, ... Sicherung wird auf dem externen Backup-Medium eine Rotation der ... sonstwohin ziehen (dump aus dem Snapshot heraus, ...
    (de.comp.sys.mac.misc)
  • Re: RAID gotchas!
    ... will keep my backup up-to-date). ... Instead of mounting the file systems and using rsync between them, we want to copy the initial system, and conveniently we'll develop a file system large ... When that is done, confirm the file backed up the root file system, and then delete the snapshot file system. ...
    (Fedora)
  • FW: LVM level snapshot backup and restore
    ... LVM level snapshot backup and restore ...
    (RedHat)