Samba has a VFS module to expose filesystem snapshots as Previous Versions to Windows clients. The official Samba documentation uses LVM volumes, but I think it is more useful if combined with Btrfs snapshots.

I made a script that, when run hourly (or otherwise) detects changes in your subvolume and creates a snapshot. If there are no changes, no snapshots are made.

## Check for most recent generation ID for most recent snapshot.
## This is used when looking for changed files.
if [ -d "$old_snap" ]; then
# find-new outputs last generation ID when using a too high value is used for comparing.
gen_id=$(/sbin/btrfs sub find-new "$old_snap" 9999999|cut -d " " -f 4)