aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmkosibuild9
1 files changed, 7 insertions, 2 deletions
diff --git a/mkosibuild b/mkosibuild
index e086365..ec12449 100755
--- a/mkosibuild
+++ b/mkosibuild
@@ -57,13 +57,18 @@ function main {
# Backup old machine
[[ -d "${BACKUPDIR}" ]] || mkdir -p "${BACKUPDIR}"
if [[ -e ".backup/${NAME}" ]]; then
+ TS="$(date +%Y%m%d%H%M%S)"
echo ""
echo "Now zipping up the old machine, for backup"
cd "${BACKUPDIR}"
if [[ "${CRON:=false}" = false ]] && [[ -x "$(command -v pv)" ]]; then
- tar c "${NAME}" | pv -s "$(du -sb "${NAME}" | awk '{print $1}')" | xz -0 - > "${BACKUPDIR}/${NAME}.tar.xz.$(date +%Y%m%d%H%M%S)"
+ echo "Size of original container: $(du -sh "${BACKUPDIR}/${NAME}" | awk '{print $1}')"
+ tar c "${NAME}" | pv -s "$(du -sb "${NAME}" | awk '{print $1}')" | xz -0 - > "${BACKUPDIR}/${NAME}.tar.xz.${TS}"
+ echo "Size of backup: $(du -sh "${BACKUPDIR}/${NAME}.tar.xz.${TS}" | awk '{print $1}')"
+ echo "All backups of ${NAME}:"
+ du -sh "${BACKUPDIR}/${NAME}.tar.xz"*
else
- tar c "${NAME}" | xz -0 - > "${BACKUPDIR}/${NAME}.tar.xz.$(date +%Y%m%d%H%M%S)${CRONSUFFIX:=-cron}"
+ tar c "${NAME}" | xz -0 - > "${BACKUPDIR}/${NAME}.tar.xz.${TS}${CRONSUFFIX:=-cron}"
fi
rm -r "${NAME}"
fi