| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| ip_0=`ip a | grep inet | grep -v inet6 | awk 'NR==2{print $2}' | cut -d '.' -f 4` |
| ip_1=${ip_0%%/*} |
| date=$(date +%Y%m%d) |
| |
| backup_floder=/home/aboss/backup/${date} |
| file_time=$(date +%Y%m%d%H%M%S) |
| sql_file=sqlchk_${file_time}.txt |
| |
| axtool_file=aboss5_ver_${file_time}.txt |
| |
| [ ! -d ${backup_floder} ] && mkdir -p ${backup_floder} |
| echo 'excuting...' |
| |
| mysql_chk=`ps x | grep 3306 | grep -v 'grep' | wc -l` |
| if [ "${mysql_chk}" == 1 ]; then |
| |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e \ |
| 'select sum(ZHYE) ZHYE from a5_fund.tfc_zjzh;' > ${sql_file} 2>/dev/null |
| |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e \ |
| 'select sum(ZQSL) ZQSL from a5_sectrade.tsc_zqgl;' >> ${sql_file} 2>/dev/null |
| |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e \ |
| 'select sum(TABLE_ROWS) ALL_ROWS from information_schema.TABLES t |
| where |
| t.TABLE_SCHEMA in ("a5_dtx","a5_fund","a5_manage","a5_secinit","a5_sectrade","a5_sysinfo") and t.TABLE_NAME not like "%copy%";' >> ${sql_file} 2>/dev/null |
| |
| echo "开始所有表汇总..." >> ${sql_file} |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e \ |
| 'select t.TABLE_SCHEMA , t.TABLE_NAME ,t.TABLE_COLLATION from information_schema.TABLES t |
| where |
| t.TABLE_SCHEMA in ("a5_dtx","a5_fund","a5_manage","a5_secinit","a5_sectrade","a5_sysinfo") and t.TABLE_NAME not like "%copy%";' >> ${sql_file} 2>&1 |
| |
| echo "开始表字段汇总..." >> ${sql_file} |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e \ |
| 'select c.TABLE_SCHEMA ,c.TABLE_NAME ,c.COLUMN_NAME ,c.COLUMN_TYPE ,c.COLUMN_KEY from information_schema.COLUMNS c |
| where c.TABLE_SCHEMA in ("a5_dtx","a5_fund","a5_manage","a5_secinit","a5_sectrade","a5_sysinfo") |
| and c.TABLE_NAME not like "%copy%";' >> ${sql_file} 2>&1 |
| mv ${sql_file} ${backup_floder} |
| |
| temp=temp.txt |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e 'select * from a5_dtx.tq2_work where jyrq=curdate();' > ${temp} 2>/dev/null |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e 'SELECT * FROM a5_odeliver11.tod_hostchk where date=curdate();' >> ${temp} 2>/dev/null |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e 'SELECT * FROM a5_odeliver12.tod_hostchk where date=curdate();' >> ${temp} 2>/dev/null |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e 'select * from a5_fund.tfc_xtzt where JYRQ=curdate();' >> ${temp} 2>/dev/null |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e 'select * from a5_manage.tmc_xtzt where JYRQ=curdate();' >> ${temp} 2>/dev/null |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e 'select * from a5_sectrade.tsc_xtzt where JYRQ=curdate();' >> ${temp} 2>/dev/null |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e 'select * from a5_secinit.tsc_xtzt where JYRQ=curdate();' >> ${temp} 2>/dev/null |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e 'SELECT * from a5_sc_syncnode1_11.tnodeinfo where TradeDate=curdate();' >> ${temp} 2>/dev/null |
| mysql -uroot -pP@ssw0rd123.abc -h127.0.0.1 -P3306 -e 'SELECT * from a5_sc_syncnode1_12.tnodeinfo where TradeDate=curdate();' >> ${temp} 2>/dev/null |
| echo "检查恢复结果...周五请忽略" |
| [ -s ${temp} ] && echo "检查不通过" || echo "检查通过" |
| else |
| echo "[ERROR] mysql process not running,please check" |
| echo "[ERROR] $(date +%Y%m%d%H%M%S) mysql process not running,please check" > ${sql_file} |
| mv ${sql_file} ${backup_floder} |
| fi |
| |
| |
| cd /home/aboss/aboss5/bin |
| ./axtool hotfix -b all > ${axtool_file} 2>&1 |
| mv ${axtool_file} ${backup_floder} |
| echo "excuted" |
| |
| |
| |
| |
| |
| |
| |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端