[root@demo home]#vi autobaktable.sh #!/bin/sh #The user does not have to change the password list file DATE=`date +"%Y%m%d"` DATETIME=`date +"%Y%m%d-%H%M%S"` /usr/local/mysql/bin/mysql -uroot -proot184** -Diusr <\iusr_user.sql > $DATETIME.xls /usr/bin/iconv -f utf8 -t gbk -o$DATE.xls $DATETIME.xls rm -fr $DATETIME.xls echo "user password not change to accessory" | /usr/bin/mutt -s "user password not change"eddy.zhou@abc.com -c james.li@abc.com, mager.guo@abc.com -a $DATE.xls
2、需要查询的数据:
[root@demo home]# cat iusr_user.sql SELECT usr_display_name,usr_email,usr_cell_phone_no,usr_params FROM iusr_user WHERE usr_password_expired=1 ORDER BY usr_params [root@demo home]# pwd /home [root@demo home]#
1、linux下查询mysql数据保存xls文件[root@demo home]#vi autobaktable.sh #!/bin/sh#The user does not have to change the password list fileDATE=`date +"%Y%m%d"`DATETIME=`date +"%Y%m%d-%H%M%S"`/usr/local