bundlewrap/bundles/systemd-timers/files/check_systemd_timer

20 lines
396 B
Bash

#!/bin/bash
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
fi
date="$(date --date="@$(cat "/var/lib/systemd-timer-monitored/$1")" "+%F %T %z")"
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