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)