From: Thierry Parmentelat Date: Tue, 11 Jun 2019 14:55:24 +0000 (+0200) Subject: rename script into renew-reminder.py (dash instead of underscore) X-Git-Tag: myplc-7.1-0~8 X-Git-Url: http://git.onelab.eu/?p=myplc.git;a=commitdiff_plain;h=9912ac8fd7062a9294c4b3d10eb729531fc170d2 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 --- 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