[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] script to know user quota
- Subject: Re: [cobalt-users] script to know user quota
- From: Andy <andy.brown@xxxxxxxxxxxxx>
- Date: Fri Sep 19 05:00:05 2003
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
On Friday 19 September 2003 5:46 am, Alfredo Musse T. wrote:
> Hi, I was wondering if someone can help me with a small script for my
> raq4 I can use via the web browser, something like "script.pl?username"
> to know 1) user's alloted disk quota and 2) user's used disk quota.
Hiya,
using
/usr/bin/quota username
gets a user quota, however it needs to run as root or the user themselves to
get the result, so its not ideal for web scripts in the method you mention.
Once possible solution:
Nightly/daily/hourly/quarter-hourly get a list of all users from /etc/passwd
/usr/bin/quota each one and write the result into a mysql database
Use cgi/php to query the mysql database and produce output to screen.
Thats one possibility and wouldn't need much code at all to do, although its
not bang-up-to-the-minute accurate.
--
Andy
andy @ raqpak . com
http://www.raqpak.com/ Unofficial Cobalt downloads/support