1
0
Fork 0

sauvegarde_mysql.sh: fix + ajout routines & events au dump

This commit is contained in:
Chl 2023-10-31 00:39:46 +01:00
parent 5caf403901
commit 160c938744

View file

@ -4,7 +4,7 @@
# Files will be named BASE_DIR/PREFIXEbasenameSUFFIXE # Files will be named BASE_DIR/PREFIXEbasenameSUFFIXE
BASE_DIR="/var/backups/bdd" BASE_DIR="/var/backups/bdd"
MYSQL_EXTRA_ARGS="" MYSQL_EXTRA_ARGS=""
MYSQLDUMP_EXTRA_ARGS="--add-drop-table" MYSQLDUMP_EXTRA_ARGS="--add-drop-table --routines --events"
PREFIXE="sauv_mysql_" PREFIXE="sauv_mysql_"
SUFFIXE=_$( date +%Y%m%d-%H%M%S ).sql.gz SUFFIXE=_$( date +%Y%m%d-%H%M%S ).sql.gz
NB_DAYS_BEFORE_DELETION="30" NB_DAYS_BEFORE_DELETION="30"
@ -121,7 +121,7 @@ printf "%s\n" "$BASES" | while read BASENAME; do
fi fi
done done
unset IFS unset IFS
mysqldump $MYSQL_EXTRA_ARGS "$BASENAME" | gzip -c > "$BASE_DIR/$PREFIXE$BASENAME$SUFFIXE" mysqldump $MYSQLDUMP_EXTRA_ARGS "$BASENAME" | gzip -c > "$BASE_DIR/$PREFIXE$BASENAME$SUFFIXE"
done done