summaryrefslogtreecommitdiff
path: root/backupStatistics.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-01-16 20:37:55 +0100
committerErich Eckner <git@eckner.net>2017-01-16 20:37:55 +0100
commit862e72f37787aba070df7e76fb847479af76c488 (patch)
tree5652cda8b816de3e22dfcf9a9cdc0b8cde3f0fc8 /backupStatistics.in
parentbecadfe1e1679755075fdff59bbd18e5d7813ac1 (diff)
downloadhardlinkedBackups-862e72f37787aba070df7e76fb847479af76c488.tar.xz
cache-Dateien nur noch vom Besitzer lesbar
Diffstat (limited to 'backupStatistics.in')
-rw-r--r--backupStatistics.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/backupStatistics.in b/backupStatistics.in
index 8de5f9c..eb66e2c 100644
--- a/backupStatistics.in
+++ b/backupStatistics.in
@@ -25,6 +25,8 @@ do_stage()
done
rm -f "${cacheDir}/${backupID}.inodes"
+ touch "${cacheDir}/${backupID}.inodes"
+ chmod go-rwx "${cacheDir}/${backupID}.inodes"
for dat in $(ls "${dest}")
do
echo "${dat}:"
@@ -40,6 +42,8 @@ do_stage()
fi
tmpDirA="$(mktemp -d)"
tmpDirB="$(mktemp -d "${cacheDir}/tmp.XXXXXX")"
+ touch "${cacheDir}/${backupID}.inodes.sorted"
+ chmod go-rwx "${cacheDir}/${backupID}.inodes.sorted"
sort -T "${tmpDirA}" -T "${tmpDirB}" -u "${cacheDir}/${backupID}.inodes" > \
"${cacheDir}/${backupID}.inodes.sorted"
rmdir "${tmpDirA}" "${tmpDirB}"
@@ -50,6 +54,8 @@ do_stage()
echo 'generate lists $inode -> $count, $contentHash'
return 0
fi
+ touch "${cacheDir}/${backupID}.content"
+ chmod go-rwx "${cacheDir}/${backupID}.content"
uniq -cm2 "${cacheDir}/${backupID}.inodes.sorted" | \
parallel \
sha512sum {=s/^ *\([[:digit:]]\+ \)\{2\}[0-9-]\+ //=} \| \
@@ -65,6 +71,8 @@ do_stage()
fi
tmpDirA="$(mktemp -d)"
tmpDirB="$(mktemp -d "${cacheDir}/tmp.XXXXXX")"
+ touch "${cacheDir}/${backupID}.content.sorted"
+ chmod go-rwx "${cacheDir}/${backupID}.content.sorted"
sort -T "${tmpDirA}" -T "${tmpDirB}" -k1,1 -k2nr,2 "${cacheDir}/${backupID}.content" > \
"${cacheDir}/${backupID}.content.sorted"
rmdir "${tmpDirA}" "${tmpDirB}"
@@ -78,6 +86,8 @@ do_stage()
index=0
tmpDirA="$(mktemp -d)"
tmpDirB="$(mktemp -d "${cacheDir}/tmp.XXXXXX")"
+ touch "${cacheDir}/${backupID}.duplicates"
+ chmod go-rwx "${cacheDir}/${backupID}.duplicates"
uniq -m1 --all-repeated=separate "${cacheDir}/${backupID}.content.sorted" | \
sed 's|^\(\S\+ \)\{2\}||' | \
while read s
@@ -107,6 +117,8 @@ do_stage()
unset firstInode
unset lastInode
+ touch "${cacheDir}/${backupID}.duplicates.files"
+ chmod go-rwx "${cacheDir}/${backupID}.duplicates.files"
sed '
s|^\(\S\+\) \S\+ |\1 F |
' "${cacheDir}/${backupID}.inodes.sorted" | \