#!/bin/bash # # ohQuota will send disk quota reports to mars and samba and other users # monthly at a certain time and update a html file that lists global disk # usage for users. # run this once a month through cron (see man cron) # hbase is the base dir where you would like place the quotas.html file. hbase="/hamster/home/httpd/html/main/" title="RAU Engineering" # Your organization's title srvname="OhMaster" # Your server's name fqdn="ohmaster.rau.ac.za" # full fqdn to your mail host adminemail="root@ohmaster.rau.ac.za" # email of the admin account wwwsite="www-ing.rau.ac.za/main" # urlpath to hbase # Month is the current month :) mnth=`date` dummy="youhavenoteditedthisscript" if [ $dummy = youhavenoteditedthisscript ] ; then echo "Please edit this script to generate your OWN html file!" exit fi cat < $hbase/quotas.html $title - Disk quotas for the slaves as on $mnth > $title
Cnr Ditton and Kingsway Ave, P.O. Box 524, Auckland Park, 2006, Tel : +27(11)-489-2016, Fax: +27(11)-489-2097

Disk space usages for the slaves as on $mnth

These are the messy living quaters of the slaves and the amount of data lying around in their homeboxes

A slave is granted 134,217,728 binary digits of space on the oh-so-precious fast wide scsi's of $srvname for their normal household information like spreadsheets, important email, scanned images etcetera etcetera. Some slaves tend to leave data on the $srvname server without ever removing it. $srvname gets upset with old data and is busy trying to reduce all files older than one year on the server to 42 bytes, a magical number picked up from somewhere.

OOOK for l in `cat /etc/ohmaillist | sort` #for l in eddie do dq=`/usr/sbin/quota $l` ddq=`/usr/sbin/quota $l | sed ' 1,2 d '` cat <> $hbase/quotas.html APESHIT cat < Reply-to: $adminemail To: $l@$fqdn <$l@$fqdn> Subject: $l's diskusage on $srvname X-Mailer: Automated disk Usage reporter script Oh Yee my little slave Greetings! This is your friendly $srvname virtual server reporting: Monthly account: Diskusage as on $mnth: $dq This is just a friendly reminder of your current disk usage. Don't panic. You only need to pay respects, no money, this is only for your records. This disk usage account will be automatically sent out every month. Please remove your old data frequently from the server if it is not in constant use. Point your URL to http://$wwwsite/quota.html to see the diskspace usage of all the users on $srvname. Redirect any replies concerning diskspace usage to your smiling net-admin staff. This is a green service: this message will self destruct in 40 seconds. (Just kidding!) EEEEK done cat <> $hbase/quotas.html
User
Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
$l
$ddq

disclaimer: $title believes in freedom of thought and speech. User webcontent is the responsibility of the user.

Last modified:

POPO