aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/files_integrity_croncheck.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/files_integrity_croncheck.sh b/scripts/files_integrity_croncheck.sh
index 0cf99d8..01b4951 100755
--- a/scripts/files_integrity_croncheck.sh
+++ b/scripts/files_integrity_croncheck.sh
@@ -23,8 +23,15 @@ mkdir -p "$output_dir"
for dir in "${dirs[@]}"; do
basefn="$(printf "%s\n" "$dir" | sed 's:/:_:g;s/^_//;s/_$//')"
outputfn="$output_dir/${basefn}_$(date +%F_%T).md5sum.gz"
+ outputlistfn="$output_dir/${basefn}.tmplist"
- find "$dir"/ -type f -print0 | sort -z | xargs -0 md5sum -b \
+ # store file list: it avoids having the complete list in memory for all
+ # the time the md5sums processes will take to complete which can be
+ # consequent.
+ ionice -c 3 nice -n 19 find "$dir"/ -type f -print0 | sort -z \
+ > "$outputlistfn"
+
+ xargs --arg-file="$outputlistfn" -0 ionice -c 3 nice -n 19 md5sum -b \
| gzip -9 > "$outputfn"
diff_two_last_by_mail \
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177