[Samba] Custom, per share (or user) dfree command?

Bjoern Baumbach bb at sernet.de
Wed Nov 28 08:25:06 MST 2012


Hi Mikael,

On 11/28/2012 03:44 PM, Бак Микаел wrote:
> I am Mikael and I am new to this list.

Welcome to the Samba mailing list :-)

> I am able to limit the user's disk usage with file system quota, but
> unfortunately the disk space and usage reported to the Windows machines
> are the total amount of storage space and the total amount of space left
> on the entire backup server. This is not that nice.
> 
> I would like to somehow tweak the way Samba reports disk usage and total
> amount of disk space to its Windows clients. I could imagine a custom
> script that I write to get the user's quota information and pass that
> along to the clients.
> 
> I have noticed that there is a "dfree command" in the global section.
> But that seems not to be able to work share specific. I must be able to
> somehow resolve a username->share mapping and get quota from that
> specific user.

You can set the "dfree command" per share, but for use with the home
shares it would need some more configuration.

> I thought about using "homes" instead of plain shares, but I'm not sure
> if that would help me in any way.

Yes, this is the problem, you should use "homes".

I think the "get quota command" option is what you are looking for.
It's a global option that specifies a custom script which receives
amongst others information about the directory (e.g. /home) and a
specific user/group. In this script you can use system tools to
determine the needed values (e.g. free/used space). Please refer to the
smb.conf man page for more information about the get quota command.
Probably you'll find such a script for you system by searching for "get
quota command" and your quota system.

Best regards
Björn

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba mailing list