[plug] Disk space probs

Leon Brooks leon at brooks.smileys.net
Fri Sep 1 16:02:12 WST 2000


Mike Holland wrote:
> Isnt that rather tedious?

Easy to automate:

    DEVICE=/dev/hdxX
    DEVRE=$(echo -n $DEVICE | sed -e 's|/|\\/|g')
    MOUNTED=$(mount | gawk "/^$DEVRE/ { print \$3 }")
    while [ $(df -m $MOUNTED | gawk "/^$DEVRE/ { print \$4 }") -lt 10 ]; do
        rm -f $(du -m $MOUNTED | sort -n | tail -1 | gawk '{ print $2 }')
    done

Wouldn't take much more to add a bytes-saved counter. (-:

-- 
"But these [serious NT security flaws] are not inherent flaws in the
 operating system -- they don't happen by accident. They are the result
 of deliberate and well-thought-out efforts." -- Mike Nash, Microsoft



More information about the plug mailing list