-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Sorry Trigon, but it doesn't work. It is calculating the percentage of the hard limit at which your soft limit is set. Not really what you wanted :)
May be we do not have the same 'quota -v' output, mine is:
Disk quotas for drtrigon (uid 1340): Filesystem usage quota limit timeleft files quota limit timeleft /home 308.2M 500.0M 1000.0M 6016 0 0
You have to consider that '1340' from '(uid 1340)' does also match the regex, so it should work fine. At least for me it does for shure since I got mail as expected. :)
Moreover, even if you fixed it ( float(size[0])/float(size[1]) ), it has problems with eg. using 600.0K out of the 500.0M quota.
That is in fact true - but to be honest if you use below 1MB you do not have any need to run this script at all... do you? ;)
Also, no need to hardcode the email address. You could simply run: (echo Subject: You are reaching your quota && quota -v ) | mail $USER
This is a good hint indeed! Thanks for that! Since I should have mentioned my script as "cheap'n'dirty" solution there is a lot space for improvement! On the other hand it is just a work-a-round for a service that should be done by the toolserver anyway and thus I did not have the motivation to write "perfect" but "just working" code.
I have mentioned that I just wanted to let profit other toolserver users from it - nobody HAS to use it... ;) Furthermore I do not give up the hope that finally some day the toolserver will do this job and the script can be trashed anyway... ;))
Greetings and have fun! DrTrigon