1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Add sort to the du command to keep things in order of size

This commit is contained in:
Christopher Desjardins 2018-09-20 12:06:05 +02:00
parent 725d904131
commit a5ed119b6e

View file

@ -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