Hello, I have a problem to solve, goal:
I want to take zfs snapshots, but before taking them I want to stop the docker containers with MySQL and apps to maintain consistency, and after I want to turn them back on,
in the GUI I don’t have the option of pre and post scripts. I can write a script that will perform this task, but I want truenas to control the period live cycle of the snapshots and send them to the 2nd truenas server for copying,
I use TS 24.10.2.2
I don’t know how to approach this. I would be incredibly grateful for help.
The snapshot lifecycle is controlled by the name of the snapshot.
So create a snapshot task that creates a snapshot with a specific naming convention and the lifetime cycle you want
Then write a script that creates a snapshot with the same naming convention as your snapshot task.
That should do it
[Caveat - I haven’t tried]
1 Like
Great, thank you very much 
I have one more question, I search the internet and even ask AI but I think it is misleading me. When I send a snapshot to the 2nd server, is there such a thing as a full and incremental one? AI says yes, from the information it analyzes it seems to me that it is not. The question is whether if I send e.g. 5 snapshots, each of which has e.g. some changes or not, and I delete e.g. the middle one, will some chain of connections be broken and I will lose the backup from the deleted one upwards?
Or does it simply send the deltas of the next snapshots but they are as if independent of the data and deleting the older snapshot will not affect the failures of other newer ones?