Crawl storage quota more than 80% of the AD domain users
Note:
1, Asperadata for the storage volume name, Ming for the domain name
2, by the MING to replace (empty), and then delete the "\", the remaining is the name after the domain name (full domain name such as: Ming\zhi.yang)
#!/bin/bash
Date= ' Date +%y%m%d '
date2= ' Date +%y%m%d-d ' 7 days ago '
Dir=/tools/aspera
/BIN/RM-RF $Dir/users_use.txt
/BIN/RM-RF $Dir/used.txt
/BIN/RM-RF $Dir/warn_$date2.txt
/usr/bin/touch $Dir/users_use.txt
/usr/bin/touch $Dir/used.txt
/usr/bin/touch $Dir/warn_$date.txt
SSH 10.0.0.40 "Quota report-x" | grep asperadata > $Dir/aspera.txt
/bin/cat $Dir/aspera.txt | awk-f[: "]+ ' {print $} ' | grep MING > $Dir/users2.txt
Sed-i ' s/ming//g ' $Dir/users2.txt
Tr-d ' \ ' $Dir/users.txt
/bin/cat $Dir/users2.txt | tr-d ' \ ' > $Dir/users.txt
For i in ' Cat $Dir/users.txt '
Do
Used= ' Cat $Dir/aspera.txt | grep $i | awk-f[: "]+ ' {print $} '
Total= ' Cat $Dir/aspera.txt | grep $i | awk-f[: ""]+ ' {print $6} '
/bin/echo $i, $Used, $Total >> $Dir/users_use.txt
/bin/echo $Used >> $Dir/used.txt
Done
For II in ' Cat $Dir/used.txt '
Do
If [$ii-gt 83880000] && [$ii-lt 104857600];then
/bin/cat $Dir/users_use.txt | grep $ii >> $Dir/warn_$date.txt
Fi
If [$ii-gt 167770000] && [$ii-lt 209715200];then
/bin/cat $Dir/users_use.txt | grep $ii >> $Dir/warn_$date.txt
Fi
Done
/usr/bin/scp-r $Dir/warn_$date.txt [email protected]:/log/aspera/
This article is from the "Linux" blog, so be sure to keep this source http://yangzhiming.blog.51cto.com/4849999/1891656
Users who crawl storage quota more than 80%