Library small, about 16G, daily increment is very small, less than 100M, so with mysqldump daily full-scale backup, the backup result information sent to the email notification DBA.
mysqlallbackup.sh
: MySQL DataBase full Backup.
# Use mysqldump--help get more detail.
# 20.20.21.11:mysqla
#
Set-x
# define Data directy
Mysqldir=/usr/local/mysqla
# Defile User,pwd
Databackupdir=/data/backup
emailfile= $dataBackupDir/email.txts
# email
[Email protected]
# backup File
logfile= $dataBackupDir/mysqlbackup.log
#DATE = ' Date-l '
echo "Full backup of the database on 10.80.21.12 begin ..." > $eMailFile
echo $ (date +%y-%m-%d-%h:%m:%s) >> $eMailFile
CD $dataBackupDir
# defile FileName
dumpfile=20_20_21_11_mysqla_$ (date +%y%m%d_%h%m%s). sql
gzdumpfile=20_20_21_11_mysqla_$ (date +%y%m%d_%h%m%s). sql.tar.gz
# $mysqlDir/bin/mysqldump-uroot-pxxxxx--skip-opt--default-character-set=utf8--extended-insert=false--triggers-r --hex-blob--all-databases--flush-logs--delete-master-logs--delete-master-logs--lock-tables=false > $dumpFile
/usr/local/mysqla/bin/mysqldump-uroot-p ' mbkangsheng#@!2010611 '-s/tmp/mysqla.sock--default-character-set=utf8-- Extended-insert=false--triggers-r--skip-opt--hex-blob--all-databases--master-data=1--flush-logs > $dumpFile
if [[$?==0]]; Then
echo "BackupFileName: $GZDumpFile" >> $eMailFile
echo "DataBase Backup success!" >> $eMailFile
Else
echo "DataBase Backup fail!" >> $emailFile
Fi
echo "--------------------------------------------------------" >> $logFile
Cat $eMailFile >> $logFile
# Send Email
Cat $eMailFile | Mail-s "MySQL Backup" $eMail
Mysqldump Full backup Script mysqlallbackup.sh