How to export all snapshots under CIFS?

Status
Not open for further replies.

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
I'd like to create a snapshot routine that looks something like this, and export it via shadow-copy ("Previous Versions") on CIFS::
  • Every 30 minutes, kept for 72 hours
  • Every 12 hours, kept for 21 days
  • Weekly, kept for 6 months
  • Offline or further snapshots for 1-3 years or as needed, or backups in addition (this list is only as an example)
Creating such a routine in 9.10.2 is easy in principle but there's two problems. First, the GUI doesn't allow much flexibility in snapshot interval (e.g., 1 day/1 week/1 month). Second, if multiple tasks are needed for a snapshot routine (as here), the GUI only seems to allow 1 of them at most to be selected and exported under "Previous Versions" via CIFS, so the client can't see all snapshots available, and exposing newer ones means not exposing older ones.

Google reveals a comment on Github that the latter issue can be worked around by clever choice of naming, but it doesn't look like it would be easy to do through the FreeNAS GUI (and might mess around with FreeNAS expectations on snapshot naming, causing other issues?):

One can expose all weekly, monthly, hourly snapshots into windows if you're clever with the snapshot naming.. use a number system such as 01, 02, 03 ,04 for week/mon/hour/day etc.. then use the format property to interpret that label as part of the date-time

vfs objects = shadow_copy2
shadow: snapdir = .zfs/snapshot
shadow: sort = desc
shadow: format = zfs-auto-snap_%S-%Y-%m-%d-%H%M
shadow: localtime = yes

too easy :)

Reading up on vfs-shadow-copy2 suggests that perhaps one could add "shadow: format = zfs-auto-snap_%S-%Y-%m-%d-%H%M" to SMB global config, overriding existing naming, and manually change the snapshot names in periodic snapshot tasks if the GUI doesn't have the needed options, or maybe use the setting "shadow:snapdirseverywhere = yes" to automagically solve everything? But I don't want to screw around and find my snapshots unusable or cause a problem in future.

Summary - It seems technically possible to expose all snapshots for a share via Previous Versions, but not doable within the GUI. So what are appropriate ways to do it within FreeNAS? I'd also like to set snapshots with frequencies not in the GUI, how to do it and not break existing functionality?
 

Stilez

Guru
Joined
Apr 8, 2016
Messages
529

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
There was already a feature request for this. Scheduled for 9.10.3, IIRC. It was enabled by recent Samba improvements.
 
Status
Not open for further replies.
Top