toolforger
Explorer
- Joined
- Aug 8, 2017
- Messages
- 60
Hi all,
I have a NAS box used by multiple users for archiving their data.
Each user gets their own volume.
I want an as hands-free operation as possible.
Ideally, it would be enough to just upload the files to an SMB share or rsync them, and the box should create a snapshot once the upload is done.
I don't know if this ideal is attainable at all (I doubt it, neither SMB nor rsync have a straightforward way to signal the end of the upload to the target system, it's just a series of file updates).
I considered using a really short snapshot frequency, but that gives a ton of snapshots of which most don't contain any value. Also, if you do a snapshot every five minutes or so, you'll likely have a snapshot that contains just half of an upload; individual files will be consistent sure enough (at least that's my understanding of how ZFS works), but if the snapshot happens while a set of files is uploaded, some files may be included in that particular snapshot and those not yet written will not.
Next I thought about triggering snapshots manually through the web console, but that's too many clicks. Worse, users will perceive this as an environment where they could damage things, which will make them feel insecure, and that's never a good thing.
Currently I'm considering shell scripting. Set up a cron job, let the script call ZFS tools to detect whether a volume has changed (does such a tool exist?), create a snapshot if the conditions are right (here I know what to do), and tell Freenas that a new snapshot exists (what command would that be?). I'm not sure whether this is a good idea though, so any feedback about this is appreciated.
Are there better/simpler approaches?
Regards,
Jo
I have a NAS box used by multiple users for archiving their data.
Each user gets their own volume.
I want an as hands-free operation as possible.
Ideally, it would be enough to just upload the files to an SMB share or rsync them, and the box should create a snapshot once the upload is done.
I don't know if this ideal is attainable at all (I doubt it, neither SMB nor rsync have a straightforward way to signal the end of the upload to the target system, it's just a series of file updates).
I considered using a really short snapshot frequency, but that gives a ton of snapshots of which most don't contain any value. Also, if you do a snapshot every five minutes or so, you'll likely have a snapshot that contains just half of an upload; individual files will be consistent sure enough (at least that's my understanding of how ZFS works), but if the snapshot happens while a set of files is uploaded, some files may be included in that particular snapshot and those not yet written will not.
Next I thought about triggering snapshots manually through the web console, but that's too many clicks. Worse, users will perceive this as an environment where they could damage things, which will make them feel insecure, and that's never a good thing.
Currently I'm considering shell scripting. Set up a cron job, let the script call ZFS tools to detect whether a volume has changed (does such a tool exist?), create a snapshot if the conditions are right (here I know what to do), and tell Freenas that a new snapshot exists (what command would that be?). I'm not sure whether this is a good idea though, so any feedback about this is appreciated.
Are there better/simpler approaches?
Regards,
Jo