Re: zfs replication tool
- In reply to: Julien Cigar : "zfs replication tool"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 20 Sep 2022 21:47:43 UTC
On 9/16/22 06:30, Julien Cigar wrote: > Hello, > > I have the case here where I have to atomically snapshot recursively a > dataset with many children (100+) but exclude a dozen of them. > > There are dozen of ZFS replication tools and I was wondering which ones > supports such case and are recommended? > > It looks like "recursivity" in a lot of tools is handled through "zfs > snapshot -r somepool" whereas ZFS also supports "zfs snapshot > somepool/ds1 somepool/ds2 somepool/ds3/child1" which is also atomic I use the zfs(8) program from a terminal to recursively create snapshots via 'zfs snapshot -r'. RTFM I do not see an exclude option. Perhaps you should file a feature request. (I also use zfs-auto-snapshot from crontab(5). AIUI it is a Ruby script that automates the 'zfs snapshot' and 'zfs destroy' commands. It is configured via command-line options and dataset properties.) The KISS solution is to organize the datasets into two hierarchies -- one for recursive snapshots and another for without. This will also facilitate incremental replication via 'zfs send -R' with the '-i' or '-I' options. A brute force approach would be to do a recursive snapshot, followed by destroying the snapshots you do not want. But, beware -- incremental replication of dataset hierarchies with missing snapshots can be problematic. Another idea is to to halt operations on the hierarchy, create snapshots of the desired datasets, and then resume operations on the hierarchy. Of course, this means coordinating with every process that uses the datasets. The dataset 'readonly' property could be used as a fail-safe while creating snapshots. Again, beware replication issues. David