[Samba] Splitting up directories with Samba variables

Jeremy Allison jra at samba.org
Tue May 29 17:46:18 MDT 2012

On Fri, May 25, 2012 at 10:16:47PM -0500, Heather Choi wrote:
> In my smb.conf file, I currently I have a user share definition as:
> [userdir]
>     path = /samba/%U
>     writeable = yes
> The problem is, the user pool is in the tens of thousands, so it is
> not practical to have that many directories within /samba.
> I'd like to somehow dynamically configure the path with
> subdirectories, using the first, and second letter of the username
> as the first and second nested subdirectory.
> So the share path for username  "JOHN" would point dynamically to
> /samba/J/O/JOHN.
> Does anyone know how to accomplish this using the user session
> variable %U?  Is there any concept of using a sub-string for a Samba
> variable?

No, there's no way I can think of to do this. Anyone else
have any good ideas ?

More information about the samba mailing list