I have set up a pull replication task from truenas1 to truenas2. I need to set up a task to delete old snapshots automatically. I could do this through a cron job, but I was really hoping that there would just be an option I could enable on the truenas2 side that would automatically take care of old snapshots after replication.
I was looking at the documentation for replication, and a lot of the fields that I thought I wanted to use turns out I probably don't want to use, they just have unfortunate titles or definitions.
Snapshot Retention Policy. I would immediately go to this on truenas2 to manage the lifetime of the snapshots on truenas2. Since truenas2 does not have a snapshot task for managing said snapshots, the name of this option tells me that this is what I want for automated cleanup of snapshots. The documentation says otherwise. It says that this is only triggered if truenas2 has no snapshot data in common with truenas1 snapshots. Useful in some key scenarios, but not what I'm looking for.
The next closest item would be Synchronize Destination Snapshots With Source. This is actually something I really do not want to do. If truenas1 is breached and someone runs a delete against all of the snapshots, then truenas2 would, presumably, delete all of its snapshots. This was one of the problems with push replication in previous versions of FreeNAS. The TrueNAS documentation says that it's for using encryption when replicating data...? Which I think might be a bug in the docs.
So in the end, I am at a loss. I did try to use Snapshot Retention Policy to do what I want. Can confirm, it does not do what I want. Regardless of whether I set to Custom or Same As Source, it will not trigger. I let the system go for a while, and on truenas2 I ended up with over 2,000 snapshots per dataset that was being replicated. On truenas1, it's a consistent 334, which is what I expect.
Is there a way to manage snapshot longevity on the destination side of a pull replication, or am I stuck doing this through a cron job?
I was looking at the documentation for replication, and a lot of the fields that I thought I wanted to use turns out I probably don't want to use, they just have unfortunate titles or definitions.
Snapshot Retention Policy. I would immediately go to this on truenas2 to manage the lifetime of the snapshots on truenas2. Since truenas2 does not have a snapshot task for managing said snapshots, the name of this option tells me that this is what I want for automated cleanup of snapshots. The documentation says otherwise. It says that this is only triggered if truenas2 has no snapshot data in common with truenas1 snapshots. Useful in some key scenarios, but not what I'm looking for.
The next closest item would be Synchronize Destination Snapshots With Source. This is actually something I really do not want to do. If truenas1 is breached and someone runs a delete against all of the snapshots, then truenas2 would, presumably, delete all of its snapshots. This was one of the problems with push replication in previous versions of FreeNAS. The TrueNAS documentation says that it's for using encryption when replicating data...? Which I think might be a bug in the docs.
So in the end, I am at a loss. I did try to use Snapshot Retention Policy to do what I want. Can confirm, it does not do what I want. Regardless of whether I set to Custom or Same As Source, it will not trigger. I let the system go for a while, and on truenas2 I ended up with over 2,000 snapshots per dataset that was being replicated. On truenas1, it's a consistent 334, which is what I expect.
Is there a way to manage snapshot longevity on the destination side of a pull replication, or am I stuck doing this through a cron job?