From 51ce34c3639f3088c9f00ed5d4ea07c32176db50 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Mon, 7 Oct 2019 13:22:27 +0200 Subject: [PATCH] compressing of db is now after server is back up --- src/backbitdb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backbitdb b/src/backbitdb index d84f214..15d732f 100755 --- a/src/backbitdb +++ b/src/backbitdb @@ -46,6 +46,10 @@ echo -n "Backing up ${dbName} database..." mysqldump --single-transaction -h localhost -u "${dbUser}" -p"${dbPassword}" "${dbName}" > "${dateDir}/${dbName}.sql" echo " OK" +echo -n "Starting service ${service}..." +systemctl start "${service}" +echo " OK" + echo -n "Compressing backed up database..." pushd "${dateDir}" > /dev/null xz -9 "${dbName}.sql" @@ -53,10 +57,6 @@ sha256sum * > sha256sums popd > /dev/null echo " OK" -echo -n "Starting service ${service}..." -systemctl start "${service}" -echo " OK" - if (( ${maxBackups} != 0 )) then nrOfBackups=$(ls -l ${outDir} | grep -c ^d)