From 601f02e588fc372cfdab30520b78423a7c75c344 Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Sat, 28 Dec 2019 11:29:32 +0100 Subject: [PATCH] progress for tar test --- backup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backup.sh b/backup.sh index 101d881..5dafef5 100644 --- a/backup.sh +++ b/backup.sh @@ -31,7 +31,13 @@ healthchck_ok(){ cd /backup echo "make archive" -tar -c --checkpoint=.1000 ${TAR_PARAM} ${TAR_EXTRA_PARAM} -f ~/$BACKUP_FILENAME ./* || healthchck_fail +FROMPATH='./*' +FROMSIZE=`du -sk ${FROMPATH} | cut -f 1`; +CHECKPOINT=`echo ${FROMSIZE}/50 | bc`; +echo "Estimated: [==================================================]"; +echo -n "Progess: ["; +tar -c --record-size=1K --checkpoint="${CHECKPOINT}" --checkpoint-action="ttyout=>" -f - "${FROMPATH}" | bzip2 > "${$BACKUP_FILENAME}"; +echo "]" cd / echo " done"