From: Rodney Simioni <rodneys@lodging.com>
Subject: advfs quotas
Date: Wed, 02 Oct 2002 14:38:34 -0400 [thread overview]
Message-ID: <GDEMIFAINLGOHJDIGNJPCECPCDAA.rodneys@lodging.com> (raw)
Original Question:THANKS to ALL; overall, edquota command is not
interactive, will need to write script.
I have parsed out my huge /etc/passwd file so that I have a file containing
the usernames. Now, I want to use the edquota
command so that I can set advfs quotas. The advfs manual did not indicate
setting quotas on a file containing usernames was possible. Can Advfs allow
me to set quotas on a file containing user names? I'm trying to avoid
setting quotas on many individual users separately or groups.
TIA
Rod
================================================
Replies:
simon.g.millard
Create a quota for a user - we'll call him default_user.
Then do this:
for i in `cat listofnames`
do
edquota -p default_user -u $i
===============================================
you could do something like
awk '{system("edquota -p proto_user -u " $1)}' userfile
this runs the edquota on each user in the userfile and copies proto_user's
settings to the user.
This assumes that userfile is a file with one username per line.
-charlie
===============================================
How about scripting it. As the edquota man page says, set 1 user and
use that user as the template. Then set all the users in a simple
shell loop like this:
for i in `cat parsedusersfrompasswd` ; do edquota -t templateuser $i ;
done
Short and sweet.
--
Jay R. Wren
===============================================
Nothing in the "edquota" reference page implies that it doesn't
expect to be interactive, but I suspect that if you made your
editor be "cat" and used the "apply a prototype allocation to
the named user" variation, you could write a script to run it
all for you. I'd try it on a few test cases first.
Tom
===============================================
If your usernames are in a file called "usernames", you can:
#ksh
#cat usernames |while read newuser; do /usr/sbin/edquota -p prueba
$newuser;done
So the quota of "prueba" user (a user you had created before and
has quota) is copied to all the users you have in your file "usernames".
Jo
===============================================
Not exactly what you want, but I've done something similar... On our
system, any given user's quota is dependent upon what group they're in.
So I created a prototype user for each group; dummy IDs with no real
login. Once the prototypes are set up, it's relatively easy to change a
bunch of users or create new users using the prototype:
vedquota -p prototype -u user
This does not pop you into an editor to change values, it just makes
everything the same as the prototype user! Put that in a script loop, and
you can do your entire userbase in a relatively short time!
Pablo
next reply other threads:[~2002-10-02 18:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-02 18:38 Rodney Simioni [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-01-14 15:37 advfs quotas vms unix
2002-09-30 19:54 Advfs Quotas Rodney Simioni
1998-08-19 15:10 ADVFs & quotas Jonathan Nicholson
1996-07-08 16:11 advfs quotas pcwood
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox