diff options
| author | St33v <github@f3rr3t.com> | 2021-05-13 10:14:54 +1000 |
|---|---|---|
| committer | St33v <github@f3rr3t.com> | 2021-05-13 10:14:54 +1000 |
| commit | 3b280827b52b4e2f51e0f42c393c746057f7370f (patch) | |
| tree | f918334ba9b6c578c7f0b238336c792a5729058d /diff.sh | |
| parent | 535f2a1c86663be3b0668a364abe1c3c240c5518 (diff) | |
move test scripts to test/ dir
Diffstat (limited to 'diff.sh')
| -rwxr-xr-x | diff.sh | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/diff.sh b/diff.sh deleted file mode 100755 index aa9e927..0000000 --- a/diff.sh +++ /dev/null @@ -1,32 +0,0 @@ - -function Differ { - MAXFILES=20 - newArchive=$(borg list :: -P $1 --last 2 --format {name}{NL}) - diffTmpFile=`mktemp /tmp/borgAutoXXXXX` # in /tmp dir - borg diff ::$newArchive > $diffTmpFile - echo newArchive: $newArchive - echo $(wc $diffTmpFile) - addFiles=$(grep '^added' ${diffTmpFile} | wc -l) - echo $addFiles - remFiles=$(grep '^removed' ${diffTmpFile} | wc -l) - echo $remFiles - totFiles=$(wc -l ${diffTmpFile} | awk '{print $1}') - echo $totFiles - echo $totFiles $addFiles $remFiles - if [ ${totFiles} -eq 0 ]; then - echo "No additions or deletions since last backup" - elif [ ${totFiles} -gt ${MAXFILES} ]; then - #echo $(head ${diffTmpFile}) - head ${diffTmpFile} - - midFiles=$(awk -v tot=$totFiles -v max=$MAXFILES 'BEGIN {print tot - max}') - echo " ... ${midFiles} more files changed (Added ${addFiles}, Removed ${remFiles})" - tail ${diffTmpFile} - else - cat ${diffTmpFile} - - fi - rm ${diffTmpFile} -} - -Differ $1 |
