From f87cfbb4355c4e153ef24532067cf54cc860c835 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 5 Jan 2023 21:51:55 -0500 Subject: [PATCH] Add systemd service/timer files --- systemd/mailman_sync.service | 13 +++++++++++++ systemd/mailman_sync.timer | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100644 systemd/mailman_sync.service create mode 100644 systemd/mailman_sync.timer diff --git a/systemd/mailman_sync.service b/systemd/mailman_sync.service new file mode 100644 index 0000000..f2efbf2 --- /dev/null +++ b/systemd/mailman_sync.service @@ -0,0 +1,13 @@ +[Unit] +Description=Synchronize Mailman lists to CMSManage API + +[Service] +User=mailman +Group=mailman +Type=oneshot +TimeoutStartSec=600 +EnvironmentFile=/opt/mailman-sync/env +ExecStart=/usr/bin/python3.9 /opt/mailman-sync/mailman_sync.py \ + --bin /usr/local/cpanel/3rdparty/mailman/bin/ \ + --api https://paperwork.claremontmakerspace.org/api/v1/paperwork/certification_definition/mailing_lists.json \ + --list-suffix _claremontmakerspace.org diff --git a/systemd/mailman_sync.timer b/systemd/mailman_sync.timer new file mode 100644 index 0000000..d85978a --- /dev/null +++ b/systemd/mailman_sync.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Periodically synchronize Mailman lists to CMSManage API + +[Timer] +OnCalendar=hourly +Persistent=true + +[Install] +WantedBy=timers.target