Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically creating share directories 1

Status
Not open for further replies.

TonyGroves

Programmer
Aug 13, 2003
2,389
IE
Does anybody know of any per-share Samba setting that will if necessary automatically create the directory associated with the share, when Samba is started? I've searched the docs and web but found nothing.

Thanks.
 
I don't think Samba itself can do it.
Perhaps you can something like this to your Samba init script?

Code:
for DIR in `/path/to/testparm -s 2>/dev/null | grep -w "path =" | awk '{print $3}'` ; do
if [ !-d $DIR ] ; then
    mkdir -p $DIR
fi



"If you always do what you've always done, you will always be where you've always been."
 
Excellent idea! I'll play around with that.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top