From 03ce27c7f2bd1f8981064426f843097ba9be7618 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Thu, 19 Nov 2020 10:15:32 +0100 Subject: [PATCH] Fix schedule backup script --- schedule/scripts/mariadb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/schedule/scripts/mariadb b/schedule/scripts/mariadb index b9b8ba5..7a83ea4 100644 --- a/schedule/scripts/mariadb +++ b/schedule/scripts/mariadb @@ -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 $?