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

Бак Микаел mikael.bak at yandex.ru
Mon Dec 3 07:32:32 MST 2012


Hi Bjoern,

On 11/28/2012 04:25 PM, Bjoern Baumbach wrote:
> 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".
> 

Yep. You are right. As soon as I switched to "homes" and set group
quotas instead of user quotas everything worked as expected. No need to
hack "dfree command" or "get quota command". I'm happy!


> 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.
> 

I found some examples in perl but as I said I did not need to implement
any special scripting after switching to "homes" and group quota on the
file system.

> Best regards
> Björn
> 

Thank you very much for kicking me in the right direction!

Have a nice day,
Mikael



More information about the samba mailing list