quota.sh->usr/scripts,symlik depuis /usr/local/bin
This commit is contained in:
parent
e0cced3e4d
commit
394531a537
1 changed files with 22 additions and 0 deletions
22
bin/all/quota
Executable file
22
bin/all/quota
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ $1 = "" ]] || [[ $1 = $USER ]] ; then
|
||||||
|
/usr/bin/quota
|
||||||
|
else
|
||||||
|
/usr/bin/quota $*
|
||||||
|
fi | awk -F'(:| *)' '
|
||||||
|
BEGIN { fs = "" }
|
||||||
|
/Disk/ { print; print "utilisé\tquota\tlimite\t%\t(en Mo)" }
|
||||||
|
{
|
||||||
|
if (NF == 2) { fs = $2 }
|
||||||
|
else if (fs != "") {
|
||||||
|
#unit = 512/1024
|
||||||
|
#system(/usr/bin/stat -c %B " fs) | getline unit
|
||||||
|
#if (fs == "/home") { total = 400 }
|
||||||
|
#else if (fs == "/var/mail") { total = 75 }
|
||||||
|
#else { total = 100 }
|
||||||
|
printf "%3.2f\t%3.2f\t%3.2f\t%3.1f\t%s\n", $2/1024, $3/1024, $4/1024, $2*100/$3, fs
|
||||||
|
#printf "%3.2f\t%3.2f\t%3.2f\t%3.1f\t%s\n", $2/1024*unit, $3/1024*unit, $4/1024*unit, $2*100/$3, fs
|
||||||
|
fs = ""
|
||||||
|
}
|
||||||
|
}'
|
Loading…
Add table
Add a link
Reference in a new issue