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