„backup.sh“ ändern
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-12-19 14:33:35 +00:00
parent 5ffa5ec1d3
commit 53cea3c2e7

View File

@@ -39,8 +39,16 @@ healthchck_ok(){
healthchck_start "Starting Backup"
cd /backup
echo "make archive"
tar -c ${TAR_PARAM} ${TAR_EXTRA_PARAM} -f ~/$BACKUP_FILENAME ./* || healthchck_fail "TAR Failed"
TAR_RETRIES=3
while [ $TAR_RETRIES -gt 0 ]; do
echo "make archive"
tar -c ${TAR_PARAM} ${TAR_EXTRA_PARAM} -f ~/$BACKUP_FILENAME ./* || healthchck_fail "TAR Failed"
if [ $? -ne 0 ]; then
TAR_RETRIES=$(($TAR_RETRIES-1))
else
TAR_RETRIES=0
fi
done
cd /
echo " done"