tl;dr can anybody recommend a snapshot based zfs backup script that's intuitive and flexible?
In my previous btrfs life I used some scripts written by someone else to do some scheduled incremental snapshotting and I'm sure it can be done with ZFS too, but the way it works is different enough that I'm not sure how.
The way it worked with the scripts I used before would start by creating a read-only snapshot, and from that create a rw version, then send the read-only snapshot over to a 2nd pool, and in that 2nd pool create a rw version from the ro version. Then I'd pass an argument to keep x number of snapshots.
I then used a rw version from the backup pool as a source for a remote cloud-based backup.
I would do this on an hourly, daily, weekly, and monthly schedule each with different retention periods. The cloud backup would source the weekly snapshot because it needed more than a day to complete a run. This was pretty simple because the latest rw snapshot was always referenced by a symlink "<pool_name>_last_rw" so all I had to do was share the symlink via smb/nfs and reboot the cloud backup machine once a week after the snap schedule and it would pick up the latest version. Generating the symlink was something the script handled.
So I think that with zfs snapshots are ro by default, and that a rw spawn from that is called a clone. I don't actually care about having a rw clone on the source pool, just the backup pool (because the cloud backup process does some writes).
I know with napp-it I can create replication jobs but I don't know about clones. I also see that it has an option for an SMB share of the replication but it looks like that is ro so it wouldn't work.
So I think what I need is a script that will make a snap, send the snap, clone a rw version of the sent snap, symlink to that latest rw clone, and roll off any snaps and clones that exceed the retention number.
Of course if anybody has a better way to go about it I'm all ears. Thanks for reading.
In my previous btrfs life I used some scripts written by someone else to do some scheduled incremental snapshotting and I'm sure it can be done with ZFS too, but the way it works is different enough that I'm not sure how.
The way it worked with the scripts I used before would start by creating a read-only snapshot, and from that create a rw version, then send the read-only snapshot over to a 2nd pool, and in that 2nd pool create a rw version from the ro version. Then I'd pass an argument to keep x number of snapshots.
I then used a rw version from the backup pool as a source for a remote cloud-based backup.
I would do this on an hourly, daily, weekly, and monthly schedule each with different retention periods. The cloud backup would source the weekly snapshot because it needed more than a day to complete a run. This was pretty simple because the latest rw snapshot was always referenced by a symlink "<pool_name>_last_rw" so all I had to do was share the symlink via smb/nfs and reboot the cloud backup machine once a week after the snap schedule and it would pick up the latest version. Generating the symlink was something the script handled.
So I think that with zfs snapshots are ro by default, and that a rw spawn from that is called a clone. I don't actually care about having a rw clone on the source pool, just the backup pool (because the cloud backup process does some writes).
I know with napp-it I can create replication jobs but I don't know about clones. I also see that it has an option for an SMB share of the replication but it looks like that is ro so it wouldn't work.
So I think what I need is a script that will make a snap, send the snap, clone a rw version of the sent snap, symlink to that latest rw clone, and roll off any snaps and clones that exceed the retention number.
Of course if anybody has a better way to go about it I'm all ears. Thanks for reading.