From: Peter Palfrader Date: Sat, 4 May 2013 11:07:55 +0000 (+0200) Subject: Add a --no-run-if-empty X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=4275a39fd0805ec013ff807c8c15aa10af2baa5c;p=mirror%2Fdsa-puppet.git Add a --no-run-if-empty --- diff --git a/modules/buildd/files/buildd-schroot-aptitude-kill.squeeze b/modules/buildd/files/buildd-schroot-aptitude-kill.squeeze index 032c5a5c8..46910f1f6 100644 --- a/modules/buildd/files/buildd-schroot-aptitude-kill.squeeze +++ b/modules/buildd/files/buildd-schroot-aptitude-kill.squeeze @@ -1,7 +1,7 @@ #!/bin/bash schroots=$(pgrep -x -u 0 schroot -d ',') -pgrep -x -u 0 -P "$schroots" aptitude | xargs ps h -o 'pid,vsz,cputime' | while read pid vsz cputime; do +pgrep -x -u 0 -P "$schroots" aptitude | xargs --no-run-if-empty ps h -o 'pid,vsz,cputime' | while read pid vsz cputime; do mb=$((vsz/1024)) [ "$mb" -lt 250 ] && continue hours=${vsz%%:*}