Guruz Log [secgroup__at__guruz.hu]

25 02 2011

Current path :: home

2011-02-25

-- Backing up FreeBSD using UFS2 snapshots with Bacula (tested on FreeBSD 8.1 with Bacula 5.0.3) --

This method uses "sysutils/freebsd-snapshot" package from ports.

Job resource:
Job {
  Name = "New-Root-Snapshot"
  JobDefs = "DefaultJob"
  FileSet = "Root Snapshot FileSet"
  Schedule = "WeeklyCycle"
  Client = New-fd
  Pool = FilePool
  Messages = Standard
  Priority = 8

  ClientRunBeforeJob = "sh -c 'gpart list >/root/gpart.list'"
  ClientRunBeforeJob = "sh -c 'fdisk -p >/root/fdisk.list'"
  ClientRunBeforeJob = "sh -c 'bsdlabel amrd0s1 >/root/bsdlabel.list'"

  ClientRunBeforeJob = "sh -c 'snapshot make /:bacula.0'"
  ClientRunBeforeJob = "sh -c 'snapshot mount /:bacula.0 /snapshot'"

  ClientRunAfterJob = "sh -c 'snapshot umount /snapshot'"
  ClientRunAfterJob = "sh -c 'snapshot make -g0 /:bacula.0'"
}
FileSet resource:
FileSet {
  Name = "Root Snapshot FileSet"
  Include {
   Options {
        Compression = GZIP6
        OneFS = yes
        signature = SHA1
        aclsupport = yes
        honor nodump flag = yes
        strippath = 1
    }
    File = /snapshot
  }

  Include {
     Options {
        wildfile = "*.bz2"
        wildfile = "*.gz"
        Exclude = yes
        Compression = GZIP6
        signature = SHA1
        aclsupport = yes
        strippath = 1
     }
     File = /snapshot/var/log
  }

#
# If you backup the root directory, the following two excluded
#   files can be useful
#
  Exclude {
    File = /snapshot/lost+found
    File = /snapshot/var/log
    File = /snapshot/var/db/bacula
    File = /snapshot/tmp
    File = /snapshot/var/tmp
    File = /snapshot/usr/tmp
    File = /snapshot/proc
    File = /snapshot/tmp
    File = /snapshot/dev
    File = /snapshot/.snap
    File = /snapshot/backup
    File = /snapshot/usr/ports
    File = /snapshot/usr/src
    File = /snapshot/usr/obj
    File = /snapshot/var/db/freebsd-update
    File = /snapshot/var/db/portsnap
  }
}

posted at: 11:08 | path: /freebsd/bacula | permalink to this entry


powered by blosxom