bundlewrap/bundles/systemd-timers/files/check_systemd_timer

21 lines
396 B
Text
Raw Permalink Normal View History

#!/bin/bash
2022-02-06 12:39:52 +00:00
if [[ -z "$1" ]]
then
echo "Usage: $0 <timer>"
exit 3
fi
if ! [[ -f "/var/lib/systemd-timer-monitored/$1" ]]
then
echo "Everything is fine"
exit 0
2022-02-06 12:39:52 +00:00
fi
date="$(date --date="@$(cat "/var/lib/systemd-timer-monitored/$1")" "+%F %T %z")"
2022-02-06 12:39:52 +00:00
echo "Timer had an error during its run on $date"
echo
echo "Remove /var/lib/systemd-timer-monitored/$1 to clean this alert"
exit 2