Professional Documents
Culture Documents
############################################################################
# END OF USER DEFINED
############################################################################
#CURRENT DATE
DT=`date +%G%m%d`
#Linux cp -i will break binlog shipping
unalias -a
count=0
for i in ${MYSQL_DATABASES[*]}; do
# Full backups should not be done more then once a day
# If they are, we going create another with Hour Min Sec
if [ -a "$BACKUP_DIR/$i.full.$DT.sql.gz" ];then
DT=`date +%G%m%d-%H%M%S`
fi
if [ $i != 'mysql' ] && [ $i != 'test' ] && [ $i != 'lost+found'
] && [ $i != 'information_schema' ]; then
## For Innodb & DBD backups add --single-transaction to
exclude table locking for duration of the backup
$MYSQL_BIN/mysqldump -u $MYSQL_USER --password="$MYSQL_P
ASS" -B $i --hex-blob --opt --single-transaction | /bin/gzip > $BACKUP_DIR/$i
.full.$DT.sql.gz
else
if [ $i != 'test' ] && [ $i != 'lost+found' ] && [ $i !
= 'information_schema' ]; then
## For MyISAM or Mix : Innodb & MyISAM & DBD
$MYSQL_BIN/mysqldump -u $MYSQL_USER --password="$MYSQL_P
ASS" -B $i --hex-blob --opt | /bin/gzip > $BACKUP_DIR/$i.full.$DT.sql.gz
fi
fi
let count++
done