From 9912ac8fd7062a9294c4b3d10eb729531fc170d2 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 11 Jun 2019 16:55:24 +0200 Subject: [PATCH] rename script into renew-reminder.py (dash instead of underscore) added systemctl resources to run this as a systemd timer also logging is now deferred to journalctl so forget about logrotate --- support-scripts/{renew_reminder.py => renew-reminder.py} | 0 support-scripts/renew_reminder_logrotate | 8 -------- systemd/renew-reminder.service | 5 +++++ systemd/renew-reminder.timer | 9 +++++++++ 4 files changed, 14 insertions(+), 8 deletions(-) rename support-scripts/{renew_reminder.py => renew-reminder.py} (100%) delete mode 100644 support-scripts/renew_reminder_logrotate create mode 100644 systemd/renew-reminder.service create mode 100644 systemd/renew-reminder.timer diff --git a/support-scripts/renew_reminder.py b/support-scripts/renew-reminder.py similarity index 100% rename from support-scripts/renew_reminder.py rename to support-scripts/renew-reminder.py diff --git a/support-scripts/renew_reminder_logrotate b/support-scripts/renew_reminder_logrotate deleted file mode 100644 index c97672a..0000000 --- a/support-scripts/renew_reminder_logrotate +++ /dev/null @@ -1,8 +0,0 @@ -/var/log/renew_reminder { - weekly - missingok - notifempty - create 0640 root root - -} - diff --git a/systemd/renew-reminder.service b/systemd/renew-reminder.service new file mode 100644 index 0000000..5de3887 --- /dev/null +++ b/systemd/renew-reminder.service @@ -0,0 +1,5 @@ +[Unit] +Description=designed to be run on a daily basis, this notifies users when one of their slices will expire within 5 days + +[Service] +ExecStart=/usr/bin/python3 /etc/support-scripts/renew-reminder.py diff --git a/systemd/renew-reminder.timer b/systemd/renew-reminder.timer new file mode 100644 index 0000000..0f285e3 --- /dev/null +++ b/systemd/renew-reminder.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs renew-reminder.py on a daily basis + +[Timer] +OnUnitActiveSec=1d +Unit=renew-reminder.service + +[Install] +WantedBy=multi-user.target -- 2.43.0