Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Kylinlin committed Sep 19, 2015
1 parent 15ba89e commit e9ca698
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions scripts/backup_mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ TODAY=`date +%F`

function Delete_Expired_Date {
EXPIRED_PERIOD=7
if [[ ! -d $BACKUP_DIR ]]; then
mkdir -p $BACKUP_DIR
fi
if [[ ! -f $BACKUP_LOG ]]; then
touch $BACKUP_LOG
fi
echo "+-----------------------"$TODAY"-------------------------+" >> $BACKUP_LOG
echo "Deleting expired backup file: " >> $BACKUP_LOG
echo `find $BACKUP_DIR -mtime +$EXPIRED_PERIOD` >> $BACKUP_LOG
Expand All @@ -44,8 +50,9 @@ function Backup_Date {
cd $BACKUP_DIR
tar -zcf $TODAY.tar.gz $TODAY/

[email protected]
mail -s "mysql slave log" $CONTACT_MAIL < $LOG_FILE
#yum install mail -y > /dev/null
#[email protected]
#mail -s "mysql slave log" $CONTACT_MAIL < $LOG_FILE
}

function Upload_Backup_Files {
Expand Down
2 changes: 1 addition & 1 deletion scripts/replication.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function Check_State {
action "Slave_SQL_Running: " /bin/false
fi

mail -s "mysql slave result" $CONTACT_EMAIL < $REPLICATION_LOG
#mail -s "mysql slave result" $CONTACT_EMAIL < $REPLICATION_LOG
}

#Call the functions
Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Setup {
if [[ ! -d /server ]]; then
mkdir /server
fi
cp backup_mysql.sh /server/
cp -f backup_mysql.sh /server/
}

Setup

0 comments on commit e9ca698

Please sign in to comment.