Fix schedule backup script

This commit is contained in:
Philippe Caseiro 2020-11-19 10:15:32 +01:00
parent 44629b4587
commit 52eadb6bf1
1 changed files with 6 additions and 4 deletions

View File

@ -9,9 +9,11 @@ DESC="Exportation des bases MariaDB"
MYSQLSAVDIR=$SAVDIR/sql
OPTION="--lock-tables"
rm -f $MYSQLSAVDIR/*.sql || true
mkdir -p $MYSQLSAVDIR
if [[ -d ${MYSQLSAVDIR} ]]
then
rm -rf ${MYSQLSAVDIR}
mkdir -p ${MYSQLSAVDIR}
fi
mariabackup --defaults-file=/etc/mysql/debian.cnf --backup --target-dir=$MYSQLSAVDIR
exit 0
exit $?