From a5ed119b6ed2d83607bcd32884f942116d9cc2b5 Mon Sep 17 00:00:00 2001 From: Christopher Desjardins Date: Thu, 20 Sep 2018 12:06:05 +0200 Subject: [PATCH] Add sort to the du command to keep things in order of size --- plugins/disk/du-2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/disk/du-2 b/plugins/disk/du-2 index de739d51..3dc5e610 100755 --- a/plugins/disk/du-2 +++ b/plugins/disk/du-2 @@ -134,7 +134,7 @@ sub daemonize { ## In the child, let's get the du infos if necessary if (cache_is_too_old() && du_not_running()) { my $dirs = $ENV{dirs}; - system("touch $LOCKFILE; du -sb $dirs > $TEMPFILE; cat $TEMPFILE > $CACHEFILE; rm $LOCKFILE; date +%s > $TIMEFILE;"); + system("touch $LOCKFILE; du -sb $dirs | sort -n -r > $TEMPFILE; cat $TEMPFILE > $CACHEFILE; rm $LOCKFILE; date +%s > $TIMEFILE;"); } exit; } ## daemonize