commit d4c68949ee1e6ae9b4a8a8295752a92524639556 parent a5f2ba58fe7ec9e0bd7fac57c70afafc8342b754 Author: Florian Dold <florian@dold.me> Date: Fri, 15 Mar 2024 09:30:20 +0100 only analyze logs since 7 days ago Diffstat:
| M | regional-currency/diagnose.sh | | | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/regional-currency/diagnose.sh b/regional-currency/diagnose.sh @@ -112,9 +112,12 @@ for unit in ${all_units[@]}; do expect_unit_active "$unit" done +SINCE="7 days ago" +echo "analysing logs since $SINCE" + for unit in ${all_units[@]}; do - num_warnings=$(journalctl -u "$unit" | grep WARNING | wc -l) - num_errors=$(journalctl -u "$unit" | grep ERROR | wc -l) + num_warnings=$(journalctl -u "$unit" --since "$SINCE" | grep WARNING | wc -l) + num_errors=$(journalctl -u "$unit" --since "$SINCE" | grep ERROR | wc -l) if [[ ( $num_errors -eq 0 ) && ( $num_warnings -eq 0 ) ]]; then continue fi