May 102015
 

I felt I was backing up way too much on my jail server. I was backing up files which would be installed as part of the OS.

Let’s look at the esimate:

*estimate level=full job="slocum jail snapshots"
Using Catalog "MyCatalog"
Connecting to Client slocum-fd at slocum.int.unixathome.org:9102
2000 OK estimate files=2,824,716 bytes=239,568,332,325
*

I decided to add these to the FileSet:

    Options {
      Exclude = yes
      WildDir = "/usr/jails/*/.zfs/snapshot/basejail"
      WildDir = "/usr/jails/*/.zfs/snapshot/bin"
      WildDir = "/usr/jails/*/.zfs/snapshot/boot"
      WildDir = "/usr/jails/*/.zfs/snapshot/lib"
      WildDir = "/usr/jails/*/.zfs/snapshot/libexec"
      WildDir = "/usr/jails/*/.zfs/snapshot/rescue"
      WildDir = "/usr/jails/*/.zfs/snapshot/sbin"
      WildDir = "/usr/jails/*/.zfs/snapshot/sys"
      WildDir = "/usr/jails/*/.zfs/snapshot/usr/bin"
      WildDir = "/usr/jails/*/.zfs/snapshot/usr/include"
      WildDir = "/usr/jails/*/.zfs/snapshot/usr/lib"
      WildDir = "/usr/jails/*/.zfs/snapshot/usr/libdata"
      WildDir = "/usr/jails/*/.zfs/snapshot/usr/libexec"
      WildDir = "/usr/jails/*/.zfs/snapshot/usr/ports"
      WildDir = "/usr/jails/*/.zfs/snapshot/usr/sbin"
      WildDir = "/usr/jails/*/.zfs/snapshot/usr/share"
      WildDir = "/usr/jails/*/.zfs/snapshot/usr/src"
      WildDir = "/usr/jails/*/.zfs/snapshot/var/ports"

      # mounts
      WildDir = "/usr/jails/*/.zfs/snapshot/dev"
      WildDir = "/usr/jails/*/.zfs/snapshot/proc"
      WildDir = "/usr/jails/*/.zfs/snapshot/basejail"
    }

That won’t make much sense until you realize I have a script which dynamically creates ZFS snapshots and lists those snapshots for the FileSet. See this gist for more information.

After making the above changes to the FileSet and issuing a reload command in bconsole, I ran the estimate again.
That didn’t save much:

*estimate level=full job="slocum jail snapshots"
Using Catalog "MyCatalog"
Connecting to Client slocum-fd at slocum.int.unixathome.org:9102
2000 OK estimate files=2,497,061 bytes=238,494,184,318

That got rid of about 325,000 files and only 1GB.

After excluding more directories and adding .NOBACKUP to various directories:

*estimate level=full job="slocum jail snapshots"
Using Catalog "MyCatalog"
Connecting to Client slocum-fd at slocum.int.unixathome.org:9102
2000 OK estimate files=2,339,698 bytes=228,993,198,507

150,000 less files and saving 10GB. Not very significant.

Let’s get a file listing.

echo 'list files jobid=205666' | bconsole > files.205666

With some massaging of that file, I identified more directories to ignore:

      WildDir = "/usr/jails/*/.zfs/snapshot/snapshot-for-backup/tmp"
      WildDir = "/usr/jails/*/.zfs/snapshot/snapshot-for-backup/usr/local/man"
      WildDir = "/usr/jails/*/.zfs/snapshot/snapshot-for-backup/usr/local/share/licenses"
      WildDir = "/usr/jails/*/.zfs/snapshot/snapshot-for-backup/usr/local/share/locale"
      WildDir = "/usr/jails/*/.zfs/snapshot/snapshot-for-backup/var/cache/pkg"
      WildDir = "/usr/jails/*/.zfs/snapshot/snapshot-for-backup/var/db/ports"
      WildDir = "/usr/jails/*/.zfs/snapshot/snapshot-for-backup/var/db/portsnap"
      WildDir = "/usr/jails/*/.zfs/snapshot/snapshot-for-backup/var/tmp/nginx"

With a few more .NOBACKUP files, had:

*estimate level=full job="slocum jail snapshots"
Using Catalog "MyCatalog"
Connecting to Client slocum-fd at slocum.int.unixathome.org:9102
2000 OK estimate files=2,339,698 bytes=228,993,198,507

Humpf.

Oh. Yes, after adding .NOBACKUP to the live filesystem, I have to take new snapshots. The job works only on snapshots so that’s what the estimate needs too.

*estimate level=full job="slocum jail snapshots"
Using Catalog "MyCatalog"
Connecting to Client slocum-fd at slocum.int.unixathome.org:9102
2000 OK estimate files=1,054,776 bytes=166,851,242,633

That’s better. Half the files. 112 less GB. Nice.

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