I am exporting a directory via Samba to my home theater PC. Unfortunately XBMC is also displaying some working directories that I happen to be sharing inside that directory.
I would like to find a way to have Samba ignore certain directories so that they are not shared with the other PCs.
This is purely for vanity reasons so the solution doesn't need to be totally perfect (So a workaround would be fine, it doesn't have to be production quality)
Best Answer
I'm thinking
veto files
is the option you're looking for.Edit
/etc/samba/smb.conf
with root rights. Under the particular share/var/test
, the following setting will exclude any descendant sub-directory or file matchingfoo
or*bar*
(beware,/
means OR):Then, you need to restart Samba with
stop
andstart
(notreload
):Note: Shares created through Nautilus GUI are defined in individual files in
/var/lib/samba/usershare
butveto files
can't be applied there. If it's your case:veto files
to the[global]
section of/var/lib/samba/usershare
. This will affect to all your global shares./var/lib/samba/usershare
and re-create it manually under/etc/samba/smb.conf
. You can't copy paste; instead, follow the guide.