From f587ea19f4f26571992470f6d71db27553539dc2 Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 22 Oct 2020 09:59:02 +0200 Subject: [PATCH] feat: add systemd unit/timer files --- misc/systemd/sentry-backup.service | 13 +++++++++++++ misc/systemd/sentry-backup.timer | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 misc/systemd/sentry-backup.service create mode 100644 misc/systemd/sentry-backup.timer diff --git a/misc/systemd/sentry-backup.service b/misc/systemd/sentry-backup.service new file mode 100644 index 0000000..ab08f54 --- /dev/null +++ b/misc/systemd/sentry-backup.service @@ -0,0 +1,13 @@ +[Unit] +Description=Sentry backup +After=docker.service + +[Service] +Type=oneshot +WorkingDirectory=/opt/sentry-backup +ExecStartPre=/bin/sh -c 'systemctl -q is-active sentry.service && systemctl stop sentry' +ExecStart=/opt/sentry-util/sentry-util.sh backup +ExecStartPost=/bin/sh -c 'systemctl start sentry' + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/misc/systemd/sentry-backup.timer b/misc/systemd/sentry-backup.timer new file mode 100644 index 0000000..e2b3727 --- /dev/null +++ b/misc/systemd/sentry-backup.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Timer for Sentry backup + +[Timer] +OnCalendar=Mon 6:00:00 + +[Install] +WantedBy=multi-user.target \ No newline at end of file