Skip to content

Commit

Permalink
add default character fore backup data
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirocow committed Mar 21, 2016
1 parent fd432fb commit 0586125
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ backup()
f_log "Exclude data from table $TABLE"
mysqldump --defaults-file=$CONFIG_FILE --no-data --add-drop-table --tab=$DST/$BDD/ $BDD $TABLE 2>> $DST/$BDD/error.log
else
mysqldump --defaults-file=$CONFIG_FILE --add-drop-table --quick --tab=$DST/$BDD/ $BDD $TABLE 2>> $DST/$BDD/error.log
mysqldump --defaults-file=$CONFIG_FILE --default-character-set=utf8 --add-drop-table --quick --tab=$DST/$BDD/ $BDD $TABLE 2>> $DST/$BDD/error.log
fi

if [ -f "$DST/$BDD/$TABLE.sql" ]; then
Expand All @@ -130,17 +130,17 @@ backup()

if [ $COMPRESS == 'bzip2' ]; then

if [ -f "$DST/$BDD/$TABLE.txt.bz2" ]; then
rm $DST/$BDD/$TABLE.txt.bz2
fi
if [ -f "$DST/$BDD/$TABLE.txt.bz2" ]; then
rm $DST/$BDD/$TABLE.txt.bz2
fi

($COMPRESS $DST/$BDD/$TABLE.txt && chown $USER:$GROUP $DST/$BDD/$TABLE.txt.bz2 && chmod $FILEATTRIBUTES $DST/$BDD/$TABLE.txt.bz2) &

elif [ $COMPRESS == 'gzip' ]; then

if [ -f "$DST/$BDD/$TABLE.txt.gz" ]; then
rm $DST/$BDD/$TABLE.txt.gz
fi
if [ -f "$DST/$BDD/$TABLE.txt.gz" ]; then
rm $DST/$BDD/$TABLE.txt.gz
fi

($COMPRESS $DST/$BDD/$TABLE.txt && chown $USER:$GROUP $DST/$BDD/$TABLE.txt.gz && chmod $FILEATTRIBUTES $DST/$BDD/$TABLE.txt.gz) &

Expand Down

0 comments on commit 0586125

Please sign in to comment.