Date: Sun, 08 May 2016 20:33:40 +0200 From: "Ronald Klop" <ronald-lists@klop.ws> To: fs@freebsd.org, "Lev Serebryakov" <lev@freebsd.org> Subject: Re: ZFS hierathy, snapshots and backup tool -- how to traverse snapshotted tree properly? Message-ID: <op.yg5pugmxkndu52@53555a16.cm-6-6b.dynamic.ziggo.nl> In-Reply-To: <886527019.20160508140221@serebryakov.spb.ru> References: <886527019.20160508140221@serebryakov.spb.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 08 May 2016 13:02:27 +0200, Lev Serebryakov <lev@freebsd.org>
wrote:
> Hello Fs,
>
> I'm writing some backup tool (yet another, don't ask!) and encounter
> some
> "inconvenience" in ZFS snapshot system, for which I don't see good
> solution
> (all I could imagine is kludgy and ugly). Maybe, there is some approach
> I
> didn't notice or some ZFS-specific API I should now?
>
> Lets say, here is some hierarchy of ZFS file systems. For example, I
> will
> use "/home" which have one filesystem per user:
>
> zpool/home/user1 -> /home/user1
> zpool/home/user2 -> /home/user2
> zpool/home/user3 -> /home/user3
>
> But it could be much more complex hierarchy.
>
> Now, we have backup tool, which works with filesystem tree. If I want to
> backup all my users, I could setup it to backup "/home" and everything
> works even if users will be added (or removed) in future.
>
> But STOP! We want to backup snapshot, if our filesystem supports
> snapshots! It is good idea! ZFS supports snapshot!
>
> It is easy to teach backup tool to call
>
> zfs snapshot -r ${backup_root}@${randomname}
>
> at beginning and
>
> zfs destroy -r ${backup_root}@${randomname}
>
> at the end of the process. No problems here.
>
> Problems are, how backup tool should TRAVERSE snapshotted directory
> tree
> now?
>
> Simple "go to ${backup_root}/.zfs/${randomname}" DOESN'T WORK! Because
> /home/.zfs/${randomname} does not contain user directories. They are
> separate FSes and have separate paths for their snapshots. Traversing
> "live" tree but getting data from snapshots is not proper way to do
> this,
> for sure, as it is depreciate whole idea of snapshots.
>
> Is here good solution for this problem?
>
> Of course, it is possible to configure each FS for backup tool
> one-by-one,
> but I don't like this solution, as in ZFS world there could be very
> deep
> and nested FS hierarchies. Also, configuring each FS separately in
> backup
> tool configuration leads to forgotten FSes in long-term maintenance for
> sure.
>
I have used a monitoring tool like Nagios to periodically check if all
filesystems are configured in the backup tool and vice versa.
Ronald.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.yg5pugmxkndu52>
