scan-bugzilla-user.sh

scan-bugzilla-user.sh

#! /bin/sh
#export LC_ALL=zh_CN.GB18030
export LC_ALL=zh_CN.UTF-8
cd /bin2/ 
sh scan-bugzilla-user-daily.sh > scan-bugzilla-user-daily.sh.log 2>&1

/usr/bin/mutt -s "scan-bugzilla-user-daily" scm-svr-mtr@scm5.***.cn < scan-bugzilla-user-daily.sh.log

scan-bugzilla-user-daily.sh

#!/bin/sh 
if [ -f scan-bugzilla-user3.txt ]
then
rm -f scan-bugzilla-user3.txt
fi
if [ -f scan-bugzilla-user1.txt ]
then
rm -f scan-bugzilla-user1.txt
fi

mysql -u root -p*** -e "use bugs; select login_name from profiles where disabledtext like '' into outfile 'scan-bugzilla-user1.txt'";
mv -f /var/lib/mysql/bugs/scan-bugzilla-user1.txt .
sed -i "/^test/"d scan-bugzilla-user1.txt
sort scan-bugzilla-user1.txt | uniq - scan-bugzilla-user3.txt
echo "***账号总数***"
cat scan-bugzilla-user3.txt | wc -l
echo "."
echo "***账号变化***"
diff scan-bugzilla-user3.txt scan-bugzilla-user.txt
cat scan-bugzilla-user3.txt > scan-bugzilla-user.txt
echo "."
echo "***账号不是集团的邮箱***"
grep -v -E '@***.com$|@***.com$|@***.com$|@***.com$|@***.com$|@***.com|@***.cn$|@***.com$|@***.cn$|@***.com$|@***.com$|@***.com.cn$|@***.com$|@***.cn$|@***.com$' scan-bugzilla-user.txt

你可能感兴趣的:(scan-bugzilla-user.sh)