Update user quota limit
we have 350 users in the system , now I want to set the size quota limit for all users , each user will allow 5M hard and 10M soft quota limit , I know it can update by the command "edquota" , could suggest what is the convenience way to update all users except run 350 times of edquota ? thx .
|
I don't know of a command to do that, so my suggestion would be a quick and dirty script. It might be easiest to write an awk script that grabs /etc/passwd and strips the first parameter. You could even just copy passwd, delete the lines that have things like root, ftp, etc, then run the script on the resulting file.
Something like cat /etc/passwd | awk -F ':' '{print $1}' | xargs YOURQUOTACOMMANDHERE should work perfect on a passwd file that had users you didn't want to quota removed. |
hi
It will be better to create the quota for one user(say user1) and duplicate (use it as a prototype) this for others.this can be done by edquota -p user1 user2.......... or u can create a group and set quota for that. |
thx reply ,
I hv generated a file called /tmp/users #vi /tmp/users user1 user2 then run the script for i in 'cat /tmp/users' do edquota $i done but it report the error : edquota: User cat doesn't exist. could suggest what is wrong , thx in advance. |
Change
for i in 'cat /tmp/users' in for i in `cat /tmp/users` I think that will help you. |
All times are GMT -5. The time now is 03:59 AM. |