How to have ZFS make snapshots of a directory only when files are changed

filesystemssnapshotzfs

Is it possible to have ZFS make snapshots of a filesystem i.e. pool/filesystem/ only when files are changed? Instead of using cron or something to automatically create a snapshot every 5 minutes is it possible to have ZFS automatically take snapshots after a file has changed?

Is this possible and what would it involve? How would you do it?

Thanks in advance.

Best Answer

Multiple Options:

1) cron based zfs diff (Solaris 11 Express++) and if something changed -> Snapshot() 2) dtrace zfs snapshot trigger

I have not done the latter, but read about it. 1) is probably the easiest way to do something, altought you might miss some changes, but you will not have snapshots with no changes piling up.

Regards, Robert