LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Update user quota limit (https://www.linuxquestions.org/questions/linux-software-2/update-user-quota-limit-271403/)

ust 12-29-2004 12:07 AM

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 .

realjustin 12-29-2004 12:19 AM

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.

jack_n_jilllll 12-29-2004 01:10 AM

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.

ust 12-29-2004 02:23 AM

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.

Kanarie 01-21-2005 04:13 PM

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.