diff options
author | Florian Dold <florian@dold.me> | 2024-03-15 09:30:20 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-03-15 09:30:20 +0100 |
commit | d4c68949ee1e6ae9b4a8a8295752a92524639556 (patch) | |
tree | 01c2548dd3d3cce410a79b5ab8e54b1aeade0a59 | |
parent | a5f2ba58fe7ec9e0bd7fac57c70afafc8342b754 (diff) | |
download | deployment-d4c68949ee1e6ae9b4a8a8295752a92524639556.tar.gz deployment-d4c68949ee1e6ae9b4a8a8295752a92524639556.tar.bz2 deployment-d4c68949ee1e6ae9b4a8a8295752a92524639556.zip |
only analyze logs since 7 days ago
-rwxr-xr-x | regional-currency/diagnose.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/regional-currency/diagnose.sh b/regional-currency/diagnose.sh index b76deca..a0c513b 100755 --- 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 |