From d547279f8dbbc5361a16a0070dae6d783555d241 Mon Sep 17 00:00:00 2001 From: Ruben Date: Thu, 17 Jul 2025 02:04:40 -0500 Subject: [PATCH] add service files, -it was unneeded here --- helperbot | 2 +- phosphorus/etc/systemd/system/helperbot-backup.service | 6 ++++++ phosphorus/etc/systemd/system/helperbot-backup.timer | 9 +++++++++ phosphorus/etc/systemd/system/helperbot-vacuum.service | 6 ++++++ phosphorus/etc/systemd/system/helperbot-vacuum.timer | 9 +++++++++ 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 phosphorus/etc/systemd/system/helperbot-backup.service create mode 100644 phosphorus/etc/systemd/system/helperbot-backup.timer create mode 100644 phosphorus/etc/systemd/system/helperbot-vacuum.service create mode 100644 phosphorus/etc/systemd/system/helperbot-vacuum.timer diff --git a/helperbot b/helperbot index c735955..a0f1d16 100755 --- a/helperbot +++ b/helperbot @@ -268,7 +268,7 @@ function postgres_vacuum_self { return 1 fi # vacuum self - docker exec -it postgres-db-1 /bin/bash -c "psql -U postgres -c 'VACUUM ANALYZE;'" + docker exec postgres-db-1 /bin/bash -c "psql -U postgres -c 'VACUUM ANALYZE;'" # unset secrets unset $(grep -v '^#' /etc/secrets/postgres.env | sed -E 's/(.*)=.*/\1/' | xargs) } diff --git a/phosphorus/etc/systemd/system/helperbot-backup.service b/phosphorus/etc/systemd/system/helperbot-backup.service new file mode 100644 index 0000000..58afa68 --- /dev/null +++ b/phosphorus/etc/systemd/system/helperbot-backup.service @@ -0,0 +1,6 @@ +[Unit] +Description=helperbot backup command + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/helperbot --backup \ No newline at end of file diff --git a/phosphorus/etc/systemd/system/helperbot-backup.timer b/phosphorus/etc/systemd/system/helperbot-backup.timer new file mode 100644 index 0000000..31680a5 --- /dev/null +++ b/phosphorus/etc/systemd/system/helperbot-backup.timer @@ -0,0 +1,9 @@ +[Unit] +Description=helperbot backup command + +[Timer] +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/phosphorus/etc/systemd/system/helperbot-vacuum.service b/phosphorus/etc/systemd/system/helperbot-vacuum.service new file mode 100644 index 0000000..a4f49e0 --- /dev/null +++ b/phosphorus/etc/systemd/system/helperbot-vacuum.service @@ -0,0 +1,6 @@ +[Unit] +Description=helperbot vacuum command + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/helperbot --vacuum \ No newline at end of file diff --git a/phosphorus/etc/systemd/system/helperbot-vacuum.timer b/phosphorus/etc/systemd/system/helperbot-vacuum.timer new file mode 100644 index 0000000..0a04858 --- /dev/null +++ b/phosphorus/etc/systemd/system/helperbot-vacuum.timer @@ -0,0 +1,9 @@ +[Unit] +Description=helperbot vacuum command + +[Timer] +OnBootSec=15min +OnUnitActiveSec=3d + +[Install] +WantedBy=timers.target \ No newline at end of file