Merge "fix random broken pipe on du command"

This commit is contained in:
Zuul 2017-12-14 09:42:02 +00:00 committed by Gerrit Code Review
commit 2445eb0e7a
1 changed files with 2 additions and 1 deletions

View File

@ -107,7 +107,8 @@ cat /tmp/dns_cache.txt | gzip - > $LOGS_DIR/dns_cache.txt.gz
# record the size of the logs directory
# -L, --dereference dereference all symbolic links
du -L -ch $LOGS_DIR/* | sort -rh | head -n 200 &> $LOGS_DIR/log-size.txt || true
# Note: tail -n +1 is to prevent the error "Broken Pipe" e.g. "sort: write failed: standard output: Broken pipe"
du -L -ch $LOGS_DIR/* | tail -n +1 | sort -rh | head -n 200 &> $LOGS_DIR/log-size.txt || true
if [[ "$PERIODIC" == 1 && -e $WORKSPACE/hash_info.sh ]] ; then
echo export JOB_EXIT_VALUE=$exit_value >> $WORKSPACE/hash_info.sh