we use the snapshot mechanism to create backups of a snap. When restoring the snapshot we first disable the snap, perform the restore and enable it afterwards. This works fine for all snaps except the one that is performing the restore. We can not disable it before running the restore. So we might get some raise condition where snapd is restoring the snap data and the snap itself is writing to snap data. In the worst case we get inconsistent data for the snap.
Is there a away to tell snapd to perform the restore “offline”, meaning that snapd handles the “disable” and “enable” part? Would it make sense to add something like this as an option to the “snapshot” action?
Or is there another best practise way for this use case?