清库脚本
[root@R610-1 db]# cat clean2.sh
#!/bin/bash
mysql -u root -p112358s -e "use uarticles_2018;show tables;" | egrep -o articles_0[12][0-9]{2} >/tmp/aa.txt
for i in `cat /tmp/aa.txt`
do
echo "TRUNCATE TABLE $i;" >>/home/db/trun_tb.txt
done
时来天地皆同力,运去英雄不自由