Samba shadow copies

From Gentoo Wiki
Jump to: navigation, search

Samba shadow copies

Samba has stackable VFS (Virtual File System) modules that can be used to extend with new feature. One such VFS module is vfs_shadow_copy2. It is used to expose filesystem snapshots as Previous Versions to Windows clients.

FILE /etc/samba/smb.confSamba config file
[share]
path = /mnt/pool/share
comment = Shadow Copy Enabled Share

vfs objects = shadow_copy2
shadow:snapdir = /mnt/pool/snapshots/
shadow:basedir = /mnt/pool/share
shadow:sort = desc
shadow:format = share_@GMT_%Y.%m.%d-%H.%M.%S
shadow:localtime = yes


shadow:format is used to match the snapshots in snapdir

user $ls -l /mnt/pool/snapshots
drwxr-xr-x 1 root    root         1252 Jan  4  2016 share_@GMT_2017.02.11-20.25.31 


Samba will automatically look for new snapshots and export them to Windows. A Windows client can then view them in the file's or folder's properties. Previous Versions as seen by a Windows client

See also

External References