# zfs snapshot poolname/filesystem@snapname
# rsync /path/to/filesystem/.zfs/snapshot/snapname/
# zfs send poolname/filesystem@snapname | ssh user@remote "zfs recv"
# zfs send poolname/filesystem@snapname > /path/to/archive/filename.whatever
olav said:But it doesnt really answer the real question? What if I run a database and it has some transactions running?
What if I have a VM image.
In the real world I would have to lock all tables in a database and drop all transactions.
For the VM image, I would have to send a command to the guest OS to flush all data to disk and then "pause" until snapshot is complete.
I might have to use something else when it comes to backup of databases and VM images?
I'm not sure how many ZFS filesystems you have, but I suggest doing a recursive snapshot of all filesystems containing data you need to back up, at whatever level will include them all (quite possibly pool). This makes the snapshots atomic, i.e. all of the snapshots you are taking with that one command are going to correspond to one exact point in time. e.g.olav said:Is this possible?
I have a file storage where there is always some writing to the disk. To create a consistent backup I would need to deny new writes and wait for the current writes to finish before taking a snapshot. Are there some tools that can help with this?
# zfs snapshot -r poolname