-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdu.sh
More file actions
executable file
·37 lines (33 loc) · 963 Bytes
/
du.sh
File metadata and controls
executable file
·37 lines (33 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash -
#===============================================================================
#
# FILE: du.sh
#
# USAGE: ./du.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: lishan (xviubu), xviubu@gmail.com
# ORGANIZATION: qdu
# CREATED: 2013年06月27日 21时10分40秒 CST
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
cd /home
du -s * |
sort -nr |
sed 10q |
while read amount name
do
mail -s "disk usage warning" $name <<- EOF
Greetings. You are one of top 10 consumers of disk space on the system.
Youe home directory uses $amount disk blocks.
Please clean up unneeded files,as soon as possible.
Thanks.
Your friendly neighborhood system administrator.
EOF
done