diff options
Diffstat (limited to 'systemd')
| -rw-r--r-- | systemd/synoptic-retry.service | 12 | ||||
| -rw-r--r-- | systemd/synoptic-retry.timer | 8 | ||||
| -rw-r--r-- | systemd/synoptic.service | 13 | ||||
| -rw-r--r-- | systemd/synoptic.timer | 9 |
4 files changed, 42 insertions, 0 deletions
diff --git a/systemd/synoptic-retry.service b/systemd/synoptic-retry.service new file mode 100644 index 0000000..ed46d41 --- /dev/null +++ b/systemd/synoptic-retry.service @@ -0,0 +1,12 @@ +[Unit] +Description=Retry download and render BOM synoptic chart (after failure) + +[Service] +Type=oneshot +User=st33v +WorkingDirectory=/var/lib/synoptic +ExecStart=/opt/synoptic/synopticChart.sh +ExecStopPost=/bin/sh -c 'STATUS=SUCCESS; [ "$$EXIT_STATUS" != "0" ] && STATUS=FAILURE; logger -t synoptic-retry -p user.err "synoptic-retry $$STATUS exit=$$EXIT_STATUS"' +SyslogIdentifier=synoptic-retry +StandardOutput=journal +StandardError=journal diff --git a/systemd/synoptic-retry.timer b/systemd/synoptic-retry.timer new file mode 100644 index 0000000..fc93089 --- /dev/null +++ b/systemd/synoptic-retry.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Retry synoptic chart download 15 minutes after failure + +[Timer] +OnActiveSec=15min + +[Install] +WantedBy=timers.target diff --git a/systemd/synoptic.service b/systemd/synoptic.service new file mode 100644 index 0000000..33e7237 --- /dev/null +++ b/systemd/synoptic.service @@ -0,0 +1,13 @@ +[Unit] +Description=Download and render BOM synoptic chart +OnFailure=synoptic-retry.timer + +[Service] +Type=oneshot +User=st33v +WorkingDirectory=/var/lib/synoptic +ExecStart=/opt/synoptic/synopticChart.sh +ExecStopPost=/bin/sh -c 'STATUS=SUCCESS; [ "$$EXIT_STATUS" != "0" ] && STATUS=FAILURE; logger -t synoptic -p user.err "synoptic $$STATUS exit=$$EXIT_STATUS"' +SyslogIdentifier=synoptic +StandardOutput=journal +StandardError=journal diff --git a/systemd/synoptic.timer b/systemd/synoptic.timer new file mode 100644 index 0000000..4884078 --- /dev/null +++ b/systemd/synoptic.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run synoptic chart download at 02:10, 08:10, 14:10, 20:10 UTC + +[Timer] +OnCalendar=*-*-* 02,08,14,20:10:00 UTC +Persistent=true + +[Install] +WantedBy=timers.target |
