#!/bin/bash #auto bakcup mysql db #by authors zgh 2019 #define backup path BAK_DIR=/data/backup/`date +%Y%m%d` MYSQLDB=mysql MYSQLUSR=root MYSQLPW=123456 MYSQLCMD=/usr/bin/mysqldump if [ $UID -ne 0 ];then echo "Must to be use root for exec Shell." exit fi if [ -d $BAK_DIR ];then echo "This $BAK_DIR is exists..." else mkdir -p $BAK_DIR echo -e "