LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   user disk quota exceed email alerts (https://www.linuxquestions.org/questions/linux-newbie-8/user-disk-quota-exceed-email-alerts-665710/)

91change 08-27-2008 04:04 AM

user disk quota exceed email alerts
 
i digged web and found

' warnquota' can be used to send warning mail once quota soft limit is exceeded .warnquota should be run as a cron job .

If i run this command once in an hour ,and user keep writing to disk ......User wont be getting an email ,until cron runs it again .....

Is there ny better tool or utility ?
Cani run warnquota once disk get fullca ?

can we invoke warnquota without cron ?

arizonagroovejet 08-27-2008 02:11 PM

Quote:

Originally Posted by 91change
If i run this command once in an hour ,and user keep writing to disk ......User wont be getting an email ,until cron runs it again .....

Well, yeah... I see what you're getting at, but how else would it work?

You could always run warnquota more often than once an hour, though I have no idea what the overhead is on it or how long it takes for one invocation to complete. I guess it depends to some extent on how many users you have. You could try running it once a minute and monitor the server load.

Even if you were able send out an email to the user the instant that they go over their soft limit there is no guarantee that they'll read it in time for it to be useful to them. There is always the risk that a user will exceed their soft limit and run in to trouble as a result before they get a warning. All you can do is make sure that if it happens they get sorted out as quickly and as easily as possible.

Quote:

Originally Posted by 91change
can we invoke warnquota without cron ?

It's just an executable, you can invoke it however you want. But if you want to run it at regular intervals then cron is the logical way to do that.


I've done quite a lot of thinking recently about how to warn users that they have gone over their quota and how to deal with them going over and their grace time expiring and then not being able to log in. I have a script which runs when a user logs in, checks their quota and pops up a warning if they're over their soft limit, then it waits about ten minutes and calls itself again and so on whilst the user is logged in. The user's home directories are mounted from servers over which I have no control and they don't use warnquota or any equivalent so this is the only mechanism by which users get warned if they go over quota unless they manually check it. If you are interested I'll post the script and link to some information I just put on my own website about how to deal with users who are over quota with grace time expired in a useful manner.

I advise paying more attention to what you type when you post. Correct use of punctuation and capitals and removing glaring typing mistakes all help make posts easier to read.

91change 08-28-2008 01:17 AM

thanks a ton .



warnquota uses configuration file /etc/warnquota.conf .

In this file , MAIL_CMD = myscript.sh for my configuration .My intention is to run the script . myscript.sh will telnet to MTA thru port 25 and send a mail . Why i use this because i dont have any MUA on my box . Everything seems to work fine .But if you look into the /etc/warnquota.conf ,we can see FROM ,SUBJECT etc but not TO field . I think TO field is get filled by warnquota executable . myscript.sh needs this TO field to work fine . How can i get it . I tried to print echo $TO in myscript.sh , but its empty .


How can i achieve this ?

Fantasio 08-28-2008 01:59 AM

establish a table with username and mail correspondance like the file aliases.
On that time, a single grep | cut will help you to set the missing "TO"


All times are GMT -5. The time now is 07:02 PM.