#!/bin/bash

#backup mysql all databases script
PATH=$PATH:/usr/local/mysql/bin/
 
BACKDIR=/backup/204/$(date +"%Y-%m-%d")
LOGFILE=/backup/204/mtk.log
#DATE=$(date +"%H:%M")
DumpFile=alldatabases.sql
GZDumpFile=$DumpFile.tar.gz
echo "" >> $LOGFILE
echo "" >> $LOGFILE
echo "-----------------------------------------" >>$LOGFILE
echo "--------+++++++++++++++++++++++++++++++++++++--------" >>$LOGFILE
echo $(date +"%Y-%m-%d %H:%M:%S") >>$LOGFILE
echo "-----------------------------------------------------" >>$LOGFILE
 
 
if [ -d $BACKDIR ]
then
cd $BACKDIR
else
mkdir -p $BACKDIR
cd $BACKDIR
fi