Zend certified PHP/Magento developer

Is it possible to automatically take zfs snapshots on boot or shutdown?

I want to create a convenient solution for full system (root-on-ZFS) backups.
The idea is to create a snapshot of the whole system on startup (before any writes to FS) or as a last step of shutdown process. That way I want to guarantee, that the FS is logically consistent, i.e. the snapshot represents the state of the cold FS (without any unfinished processes).
Later this snapshot can be backed up with zfs send to another location, if necessary.

Again, the idea is to guarantee, not that just all I/O operations are finished and consistent, but that all processes finished, so the FS state is globally and logically consistent.
For instance, it is impossible, that some program has written file a and it got into snapshot, but finished writing to file b a microsecond later, so file b is not present in the snapshot, while for program operation it is necessary, that the files are in sync.