fix slow tar and added progress bar

This commit is contained in:
locker98 2024-06-09 22:19:45 -04:00
parent 90fed6868e
commit b92e814cf7

10
backup
View File

@ -32,18 +32,14 @@ echo ""
echo -e "\e[0mStarting Backup"
tar -pcvf $BACKUP_LOCATION ./*.bak
SIZE=`python3 -c "print($(cat *.bak | tr '\n' '\0' | xargs -0 du -sk | cut -f 1 | tr '\n' '+')0)"`
tar -cpT *.bak -f - 2>/dev/null | pv -p -s ${SIZE}k > $BACKUP_LOCATION
while read folder; do
# list the contents of each folder
echo -e "\e[32mBacking Up: $folder"
tar -r -p -f $BACKUP_LOCATION $folder &>/dev/null
done < *.bak
echo ""
if [ "$COMPRESS" = true ];
then
echo -e "\e[0mCompressing Backup"