ezjail-jail: making a full backup of a FreeBSD jail with Bacula

I’ve been using Bacula since early 2004. I’ve been using FreeBSD since 1998. Jails are a relatively newcomer. I starting using it later in 2004. But it’s only recently that I’ve started using them intensively.

Backups are always a touchy subject. With ezjail, the files you need to backup are greatly reduced. You’re not backing up the base OS, just the local files. I’ve created a fileset which seems to do the right thing. It’s not generic, and it needs to be altered for each jail.

FileSet {
  Name = "mailjail"
  Include {
    Options {
      signature=MD5
    }
    File = /usr/jails/YOURJAIL/
  }
  Exclude {
    File = /usr/jails/YOURJAIL/basejail
    File = /usr/jails/YOURJAIL/bin
    File = /usr/jails/YOURJAIL/boot
    File = /usr/jails/YOURJAIL/lib
    File = /usr/jails/YOURJAIL/libexec
    File = /usr/jails/YOURJAIL/rescue
    File = /usr/jails/YOURJAIL/sbin
    File = /usr/jails/YOURJAIL/sys
    File = /usr/jails/YOURJAIL/usr/bin
    File = /usr/jails/YOURJAIL/usr/include
    File = /usr/jails/YOURJAIL/usr/lib
    File = /usr/jails/YOURJAIL/usr/libdata
    File = /usr/jails/YOURJAIL/usr/libexec
    File = /usr/jails/YOURJAIL/usr/ports
    File = /usr/jails/YOURJAIL/usr/sbin
    File = /usr/jails/YOURJAIL/usr/share
    File = /usr/jails/YOURJAIL/usr/src
    File = /usr/jails/YOURJAIL/var/ports

    # mounts
    File = /usr/jails/YOURJAIL/dev
    File = /usr/jails/YOURJAIL/proc
    File = /usr/jails/YOURJAIL/basejail
  }
}

This fileset assumes:

  1. you are using ezjail
  2. your jails are based at /usr/jails
  3. your jail name is YOURJAIL
  4. the backup runs in the jail host, not the jail

I would prefer to run bacula-fd in the individual jails, in which case, a generic fileset can be used. It can be created by deleting all instances of the /usr/jails/YOURJAIL string from the above fileset.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top