From 639f96119073d2c1b9f2386321f0268441307c59 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Thu, 1 Feb 2024 22:20:44 +0100 Subject: [PATCH] fileserver: fix snapshots (#717) Reviewed-on: https://git.mgrote.net/mg/homeserver/pulls/717 Co-authored-by: Michael Grote Co-committed-by: Michael Grote --- group_vars/fileserver.yml | 3 ++- roles/mgrote_fileserver_smb/templates/smb.conf.j2 | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/group_vars/fileserver.yml b/group_vars/fileserver.yml index 5ccc4856..b9bbf595 100644 --- a/group_vars/fileserver.yml +++ b/group_vars/fileserver.yml @@ -23,4 +23,5 @@ smb_workgroup: WORKGROUP smb_min_protocol: "SMB2" smb_client_min_protocol: "SMB2" smb_client_max_protocol: "SMB3_11" -smb_enable_snapshots_dir: false +smb_enable_snapshots_dir: true +smb_enable_snapshots_shadow: true diff --git a/roles/mgrote_fileserver_smb/templates/smb.conf.j2 b/roles/mgrote_fileserver_smb/templates/smb.conf.j2 index 5b35c8c3..29c3b9c2 100644 --- a/roles/mgrote_fileserver_smb/templates/smb.conf.j2 +++ b/roles/mgrote_fileserver_smb/templates/smb.conf.j2 @@ -11,15 +11,16 @@ ##======================= catia ======================= vfs objects = catia catia: mappings = {{ smb_catia_mappings }} -{% elif smb_enable_snapshots_shadow is sameas true and smb_enable_snapshots_dir is sameas false %} +{% elif smb_enable_snapshots_dir is sameas false and smb_enable_snapshots_shadow is sameas true %} ##======================= shadow_copy2 ======================= -vfs objects = {{ smb_shadow_vfs_objects }} +vfs objects = shadow_copy2 shadow: snapdir = {{ smb_shadow_snapdir }} shadow: sort = {{ smb_shadow_sort }} shadow: format = {{ smb_shadow_format }} shadow: snapprefix = {{ smb_shadow_snapprefix }} shadow: delimiter = {{ smb_shadow_delimiter }} shadow: localtime = {{ smb_shadow_localtime }} +shadow: snapdirseverywhere = yes {% elif smb_enable_snapshots_shadow is sameas true and smb_enable_snapshots_dir is sameas true %} #======================= vfs objects ======================= vfs objects = shadow_copy2, catia