rename script into renew-reminder.py (dash instead of underscore)
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 11 Jun 2019 14:55:24 +0000 (16:55 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 11 Jun 2019 14:55:24 +0000 (16:55 +0200)
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 [moved from support-scripts/renew_reminder.py with 100% similarity]
support-scripts/renew_reminder_logrotate [deleted file]
systemd/renew-reminder.service [new file with mode: 0644]
systemd/renew-reminder.timer [new file with mode: 0644]

diff --git a/support-scripts/renew_reminder_logrotate b/support-scripts/renew_reminder_logrotate
deleted file mode 100644 (file)
index c97672a..0000000
+++ /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 (file)
index 0000000..5de3887
--- /dev/null
@@ -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 (file)
index 0000000..0f285e3
--- /dev/null
@@ -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