trsync tree limitation

This commit is contained in:
Maciej Krok 2019-07-23 07:14:14 +02:00
parent b9631e016e
commit 316a6ec0f4

View File

@ -1,8 +1,21 @@
#!/bin/bash #!/bin/bash
HEADTREE=75
TAILTREE=75
if [ $# -eq 2 ]; then if [ $# -eq 2 ]; then
tree -ha --du "$1" TREEFILE=$(mktemp -t treefile)
time rsync -vazh --progress --partial "$@" tree -ha --du "$1" >> $TREEFILE
if [ $(cat $TREEFILE | wc -l) -gt $[TAILTREE + HEADTREE] ]; then
head -${HEADTREE} $TREEFILE
echo ...
tail -${TAILTREE} $TREEFILE
echo Full tree in $TREEFILE
else
cat $TREEFILE
fi
time rsync -vazh --progress --partial "$@"
else else
time rsync "$@" time rsync "$@"
fi fi