标签:admin nbsp OLE .sql .sh mys mysqldump ros for循环
对mysql数据库中的每张表进行按日期备份,思想是:先把每张表的表名取出取出,然后通过for循环去对每个表进行按日期备份
[root@ZFVM-APP-0-171 backup]# vim dataname.txt bamboo cactus camellia coupon daisy facility gladiolus lilac lily orchild p2p_admin pansy rose tulip violet wisteria xxl_job
[root@ZFVM-APP-0-171 backup]# vim sqlbackup.sh #!/bin/bash TIME=`date +%F` for i in `cat dataname.txt` do mysqldump -u root -pRXW2018! $i > $i-$TIME.sql done
标签:admin nbsp OLE .sql .sh mys mysqldump ros for循环
原文地址:https://www.cnblogs.com/zhong-11/p/9561842.html