mysql database backup script

#!/bin/bash DBName=myql DBUser=root DBPasswd=123456 BackupPath=/root/ LogFile=/root/db.log DBPath=/var/lib/mysql/ NewFile=”$BackupPath”db$(date + %Y%m%d).tgz DumpFile=”$BackupPath”db(date + %Y%m%d) OldFile=”$BackupPath”db(date +%Y%m%d –date=’5 days ago’).tgz echo “——————————————-” >> $LogFile echo $(date +”%y-%m-%d %H:%M:%S”) >> $LogFile echo “————————–” >> $LogFile if [ -f $OldFile ] then rm -rf $OldFile >>$LogFile 2>&1 echo “[$OldFile]Delete Old File Success!” >> $LogFile else echo “[$OldFile]No Old Backup […]