[Samba] how to disable a share
rpenny at samba.org
Mon Sep 12 11:49:53 UTC 2016
On Mon, 12 Sep 2016 13:25:35 +0200
Pol Hallen via samba <samba at lists.samba.org> wrote:
> Hi all,
> I've a simple share folder (samba version 4.2.x)
> I'd like to disable that share from 8pm to 8am.
> I think using cron to change share permission on (ie) chmod 000 share
> is there a clean feature within samba?
You could add '; available = no' to the share in smb.conf, then
write a script to remove the ';' and run 'smbcontrol smbd reload-config'
You would also need another script to put the ';' back and run
'smbcontrol smbd reload-config' again.
Then get cron to run the first script at 8pm and the second at 8am
More information about the samba