Add a --no-run-if-empty
authorPeter Palfrader <peter@palfrader.org>
Sat, 4 May 2013 11:07:55 +0000 (13:07 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sat, 4 May 2013 11:07:55 +0000 (13:07 +0200)
modules/buildd/files/buildd-schroot-aptitude-kill.squeeze

index 032c5a5..46910f1 100644 (file)
@@ -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%%:*}