Operating System - Linux
1829113 Members
11019 Online
109986 Solutions
New Discussion

Re: Limit the user size quota

 
SOLVED
Go to solution
peterchu
Super Advisor

Limit the user size quota

We have about 300 users in the system , part of them was limited the user size quota ( /sbin/edquota userid ) , except run the edquota command for every user , what is the simpliest way to set the control for all user ? thx.
5 REPLIES 5
Alexander Chuzhoy
Honored Contributor
Solution

Re: Limit the user size quota

To add all users to a primary group "quotagroup" or something, and then to assign quota limit to this group insead of to particular user...
Steven E. Protter
Exalted Contributor

Re: Limit the user size quota

you could also do this:

make a list of users to be in the quota group put it in a file


while read -r user
do
# edquota command
done < filename
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Andrej Vavro
Frequent Advisor

Re: Limit the user size quota

Setup quota for user1 and copy to the rest of users by:
edquota -p user1 `awk -F: '$3>499 && $3<1000 {print$1}' /etc/passwd`

change uid whatever you need
Andrej
Andrej Vavro
Frequent Advisor

Re: Limit the user size quota

there should be a space {print $1}
Mobeen_1
Esteemed Contributor

Re: Limit the user size quota

Peter,
I go along with Alexander's approach. The best possibility would be to have a group and go by quota for that group rather than the users.

So basically you create a group and have quota on that and assign your users (whom you want to limit quota) to that group

regards
Mobeen