From 390af9a88d32306b789a0e8858d375bf8ca054b0 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 16 Oct 2019 17:07:51 -0400 Subject: [PATCH] improve perf --- system-status | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/system-status b/system-status index 25a637e..460d63b 100755 --- a/system-status +++ b/system-status @@ -100,7 +100,13 @@ write-status() { ## check if last snapshot was within an hour vol=o - snaps=(/mnt/root/btrbk/$vol.20*) + # this section generally copied from btrbk scripts, but + # this part modified to speed things up by about half a second. + # I'm not sure if its quite as reliable, but it looks pretty safe. + # Profiled it using time and also adding to the top of the file: + # set -x + # PS4='+ $(date "+%2N") ' + snaps=($(ls -1avdr /mnt/root/btrbk/$vol.20*|head -n1)) now=$(date +%s) maxtime=0 for s in ${snaps[@]}; do -- 2.30.2