X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=system-status;h=430f8061c1c6611eafea56f369211c46d8804f94;hp=747e2a6604542ed4894ce3e68fbf18174c0401df;hb=6061d88c7d5beda3e974943eb8676f7c39d4ae9f;hpb=7d5e9e87105fafa2243603f958c8b41cdaa7f0ad diff --git a/system-status b/system-status index 747e2a6..430f806 100644 --- a/system-status +++ b/system-status @@ -88,9 +88,9 @@ write-status() { if [[ -e $f ]]; then now=$(date +%s) fsec=$(stat -c%Y $f) - # the / 60 makes it 0-59 seconds less strict, +1 makes sure we + # the / 60 makes it 0-59 seconds less strict, +1 to help make sure we # dont have any false positives. - fmin=$(( (fsec - now ) / 60 + 1 )) + fmin=$(( (fsec - now + 1 ) / 60 )) fminplus=$(( fmin + 60*24 )) # Filesystem files get copied, so find any newer than the last run. # The rest are hueristics: @@ -104,8 +104,8 @@ write-status() { if grep -qxF $HOSTNAME $x; then all_dirs+=( ${x%.hosts} ); fi done - # just because i forget a lot, -mmin -NUM means files modified <= NUM minutes ago - if [[ $(find ${all_dirs[@]} -mmin $fmin -type f -print -quit 2>/dev/null) ]]; then + # Just because i forget a lot, -mmin -NUM means files modified <= NUM minutes ago + if (( fmin < 0 )) && [[ $(find ${all_dirs[@]} -mmin $fmin -type f -print -quit 2>/dev/null) ]]; then v conflink newer filesystem files chars+=("CONFLINK!") break