-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters