Mysqldump full backup shell script sharing today, the tester urged that the relevant bug database data must be backed up, and the full backup should be performed on a daily basis; for this database with a small amount of data, I feel that it is not necessary to become a mentor so that I can develop two sets of solutions for maintenance at the same time! However, if the requirement is raised, we need to solve it. The following is a simple full-Backup mysqldump script written in the morning ;#! /Bin/sh ################################ this script is used for full data backup # Justin sun # Make a full backup every Sunday ############################# ### set the user name and password v_user = "root" v_password = "DataBase4862) (* 7 "# mysql installation path MysqlDir =/usr/local/bin # backup database =" bugtracker "# Set the backup path, create backup folder BackupDir =/data/Mysql_BackupFull_Backup = $ BackupDir/Full_backup mkdir-p $ Full_Backup/$ (date + % Y % m % d) # Start backup, record backup start time echo '=========' $ (date + "% Y-% m-% d % H: % M: % S ") '==========' "backup start"> $ Full_Backup/full_buckup.log $ MysqlDir/mysqldump-u $ v_user-p $ v_password -- single-transaction -- flush -logs -- databases $ database> $ Full_Backup/$ (date + % Y % m % d) /full_backup. SQL # compress the backup file gzip $ Full_Backup/$ (date + % Y % m % d) /full_backup. SQL echo '===========' $ (date + "% Y-% m-% d % H: % M: % S ") '==========' "backup completed"> $ Full_Backup/full_buckup.log