Samba shadow copies
Samba has stackable VFS (Virtual File System) modules that can be used to extend with new features. One such VFS module is vfs_shadow_copy2. It is used to expose filesystem snapshots as Previous Versions to Windows clients.
Configuration
FILE
/etc/samba/smb.conf
Samba config file<syntaxhighlight lang="ini">[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</syntaxhighlight>
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
Usage
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.
See also
- Btrfs snapshots - Automatic snapshots with Btrfs filesystem.
- Samba/Guide - Gentoo Samba Guide
External resources
This article is issued from Gentoo. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.