LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-13-2009, 03:42 AM   #1
sgb
LQ Newbie
 
Registered: Nov 2007
Posts: 5

Rep: Reputation: 0
Users can't get own quota information - CentOS 5


Hello,

CentOS 5 multiuser environment, SELinux enabled, /home and /tmp noexec.

I have recently set up a host for our users to process and store log files instead of using their own desktop machines. The previous incarnation of this was constantly short of space, so I have implemented user quotas.

I have not been able to find a way to notify a user of their current quota usage, except for warnquota, and for various reasons notifying the users via email is not appropriate (even to their mail account on the machine itself). Ideally I would like to output the user's current usage on login and have the user able to generate the report themselves.

At the moment, I have a cron job that runs every 5 minutes that greps the relevant info from repquota and writes to to a (read only) .quota file in the root of their home directories. I have added a script to /etc/bashrc to detect whether this file exists and if so cat it on login.

Is there any way to make the report real-time, or is there a way for a user to initiate their own report?


Thanks,

sgb
 
Old 01-13-2009, 04:34 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,378

Rep: Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755
You could give them sudo to run warnquota only.
 
Old 01-13-2009, 05:16 AM   #3
sgb
LQ Newbie
 
Registered: Nov 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks, but I have found the solution and I'm pretty ashamed to say it's very straightforward. After trying various things, such as your sudo suggestion against the utility 'repquota', which outputs to the command line instead of mail, I found the simple 'quota' utility which reports the user's personal quota.

What had me barking up the wrong tree is that the repquota man page says the following:

'Only the super-user may view quotas which are not their own'

suggesting that end users should be able to view their own quota with repquota. That does not seem to be the case. 'quota' is the correct utility.

Thanks for your help.

sgb
 
Old 01-13-2009, 06:00 AM   #4
sgb
LQ Newbie
 
Registered: Nov 2007
Posts: 5

Original Poster
Rep: Reputation: 0
If anyone is interested, this is the line that will go in /etc/skel/bashrc

Code:
/usr/bin/quota  | tail -1 | awk '{print "You are using "int($1/$2*100)"% of your quota";print $1" of "$2" KB"; }'
Which will output this on login:

Code:
You are using 52% of your quota
3328160 of 6291456 KB
Regards,

sgb
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with quota for users. wegadnie Linux - General 9 12-24-2008 01:23 AM
centOS 4.4 user quota not working ! jimmyjiang Red Hat 0 05-11-2007 02:57 PM
Quota error - CentOS 4.4 Heinz09 Linux - Server 2 05-10-2007 07:50 AM
Displaying users email quota in SM? panicbox Linux - Software 3 01-19-2006 12:34 AM
quota for email of users monin Linux - Newbie 4 05-18-2002 02:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration