fix slow tar and added progress bar
This commit is contained in:
parent
90fed6868e
commit
b92e814cf7
10
backup
10
backup
@ -32,18 +32,14 @@ echo ""
|
|||||||
|
|
||||||
echo -e "\e[0mStarting Backup"
|
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 ""
|
echo ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$COMPRESS" = true ];
|
if [ "$COMPRESS" = true ];
|
||||||
then
|
then
|
||||||
echo -e "\e[0mCompressing Backup"
|
echo -e "\e[0mCompressing Backup"
|
||||||
|
Loading…
Reference in New Issue
Block a user