[TriLUG] Over quota script

John Beimler john at radiomind.com
Sun Sep 15 22:24:46 EDT 2002


On Sun, 2002-09-15 at 21:51, Jon Carnes wrote:
> Try something like this:
>   #! /bin/bash
>   #
>   # Check for users that are over quota.
>   # Assume all user dirs are under /home
>   # look for folks above 40000kb (quota)
>   #
>   # Walk the users data tree to find the directory totals
>   cd /home
>   du -k > /root/tmp/guber
> [...]

now Jon, I thought you had learned about mktemp. :)

mktemp will give you a temp file with a semi-random name, in /tmp. 
Makes securing stuff easier (and you don't need to write to root's home
directory, and you don't have a predictable temp file for people to
attempt to exploit.

Peace.

john



More information about the TriLUG mailing list