Need help!! script for quotas

here is the file i must use to write my script (from a repquota -g) :

Group used soft grace ...

group1 -- 270000 0 0 ...
group2 -- 1500005 0 0 ...
group3 -- 55 0 0
... ... ... ... ...

the script has to assign a quota on each group (depending on the space-disk the group already uses). As a result, I have to obtain after a repquota -g :

Group used soft grace

group1 -- 270000 500000 505000
group2 -- 150000 2000000 2005000
group3 -- 55 200000 205000
... ... ... ...

(as u can see, the grace column must be 5000 Ko higher than the soft comlumn)

Can someone guide me? I dont even know how to start???

Thanks for replying fast!

:slight_smile:

Do you know what commands to use for finding the information you are looking for? If so, then think about how you would do this manually, and then put that logical thinking into a script which does the same.

First, figure out which shell or programming language you are going to use.
Second, find the commands that will gather the information you need (such as disk space, who is on what disk,....).
Third, start experimenting.

Post back what OS/version, what shell you are going to use, if this will be a manually run script or batch...

Do you know what commands to use for finding the information you are looking for?

==> i guess i'll use edquota -p group1 group2 (to apply an existing quota grom group1 to group2....

First, figure out which shell or programming language you are going to use.

==> i started in ksh....the only language i nearly know

Second, find the commands that will gather the information you need (such as disk space, who is on what disk,....).
Third, start experimenting.

here are several lines i started to write :

#!/bin/ksh
CPT=1
GROUP_NAME=""
USED_SPACE_GROUP=""

GROUP_NAME=`cut -c1-10 $QUOTA_LIST | sed -n $CPT\p`
USED_SPACE_GROUP=`cut -c24-33 $QUOTA_LIST | sed -n $CPT\p`
CPT=$CPT+1

etc...

Post back what OS/version

==> alpha OSF1 V5.1

Is it a good start???