January 2004
Intermediate to advanced
368 pages
7h 25m
English
Most system administrators seek the easiest way to solve a problem, and the easiest way to manage disk quotas is to extend the fquota script, Script #39, to include the ability to email warnings directly to users who are consuming too much space.
#!/bin/sh # diskhogs - Disk quota analysis tool for Unix; assumes all user # accounts are >= UID 100. Emails message to each violating user # and reports a summary to the screen. MAXDISKUSAGE=20 violators="/tmp/diskhogs0.$$" trap "/bin/rm -f $violators" 0 for name in $(cut -d: -f1,3 /etc/passwd | awk -F: '$2 > 99 { print $1 }') do echo -n "$name " # You might need to modify the following list of directories to match # the layout of your disk. Most likely change: ...Read now
Unlock full access