From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Rodney Simioni Newsgroups: gmane.os.tru64.managers Subject: advfs quotas Date: Wed, 02 Oct 2002 14:38:34 -0400 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1033583917 4681 127.0.0.1 (2 Oct 2002 18:38:37 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 2 Oct 2002 18:38:37 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 17woOK-0001DL-00 for ; Wed, 02 Oct 2002 20:38:36 +0200 Original-Received: (qmail 7218 invoked by uid 5); 2 Oct 2002 18:38:44 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 7191 invoked by uid 49493); 2 Oct 2002 18:38:43 -0000 Original-Received: from rodneys@lodging.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.24. spamassassin: 2.50-cvs. Clear:SA:0(-1.0/5.0):. Processed in 0.473456 secs); 02 Oct 2002 18:38:43 -0000 Original-Received: from unknown (HELO emroute2.cind.ornl.gov) (128.219.159.41) by 0 with SMTP; 2 Oct 2002 18:38:43 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H3D00LU5AGHEC@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 02 Oct 2002 14:38:42 -0400 (EDT) Original-Received: from a1.ipcc.com (ns1.ipcc.com [207.247.25.136]) by emroute2.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H3D00C0AAGBMM@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 02 Oct 2002 14:38:36 -0400 (EDT) Original-Received: from TECHGUY2 ([207.247.25.131]) by a1.ipcc.com (8.9.0/8.9.0) with SMTP id OAA22603 for ; Wed, 02 Oct 2002 14:38:34 -0400 (EDT) Original-To: tru64-unix-managers@ornl.gov X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal Xref: main.gmane.org gmane.os.tru64.managers:1934 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:1934 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