diff options
-rwxr-xr-x | mkosibuild | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -77,7 +77,11 @@ function main { echo "" echo "Now zipping up the old machine, for backup" cd "${BACKUPDIR}" - tar c "${NAME}" | xz -0 - > "${BACKUPDIR}/${NAME}.tar.xz.$(date +%Y%m%d%H%M%S)${SUFFIX}" + if [[ ${CRON} = 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)${SUFFIX}" + else + tar c "${NAME}" | xz -0 - > "${BACKUPDIR}/${NAME}.tar.xz.$(date +%Y%m%d%H%M%S)${SUFFIX}" + fi rm -r "${NAME}" # Delete old backups |