From 62573195d9dc53cd8203317127f6887af5c59170 Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Sun, 21 Nov 2021 17:11:26 +0200 Subject: [PATCH] systemd: add matterbridge-cleanup.{service,timer} Resolves: #98 --- etc/systemd/system/matterbridge-cleanup.service | 12 ++++++++++++ etc/systemd/system/matterbridge-cleanup.timer | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 etc/systemd/system/matterbridge-cleanup.service create mode 100644 etc/systemd/system/matterbridge-cleanup.timer diff --git a/etc/systemd/system/matterbridge-cleanup.service b/etc/systemd/system/matterbridge-cleanup.service new file mode 100644 index 00000000..83c3a6cc --- /dev/null +++ b/etc/systemd/system/matterbridge-cleanup.service @@ -0,0 +1,12 @@ +[Unit] +Description=Matterbridge mediarepo cleanup for things older than a wekk + +[Service] +Type=oneshot +ExecStart=/usr/bin/find /var/www/html/matterbridge -type f -cmin +10080 -delete +User=matterbridge +StandardOutput=null +StandardError=null + +[Install] +WantedBy=multi-user.target diff --git a/etc/systemd/system/matterbridge-cleanup.timer b/etc/systemd/system/matterbridge-cleanup.timer new file mode 100644 index 00000000..7a58aa26 --- /dev/null +++ b/etc/systemd/system/matterbridge-cleanup.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Run matterbridge cleanup every minute + +[Timer] +OnCalendar=*-*-* *:*:00 +OnBootSec=0 +Persistent=true + +[Install] +WantedBy=timers.target