summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-04-24 21:56:42 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-04-29 21:53:13 -0400
commitffb88bb9082b68ec928811d05c76bcab8431a37b (patch)
tree99d2bb437e8a5f64dd712c519a92a50fd35a4076
parent4c5512bedf7f1074cef365cca3ff32c936ccdfab (diff)
Add systemd units to run cron jobsparabola/20180429.1
These reflect the current active cron jobs of repo@winston.parabola.nu
-rwxr-xr-xcron-jobs/update-lastsync4
-rw-r--r--systemd/db-cleanup.service7
-rw-r--r--systemd/db-cleanup.timer9
-rw-r--r--systemd/db-import@.service12
-rw-r--r--systemd/db-import@.timer8
-rw-r--r--systemd/db-import@archlinux32.timer.d_time.conf2
-rw-r--r--systemd/db-import@archlinuxarm.timer.d_time.conf2
-rw-r--r--systemd/db-import@community.timer.d_time.conf2
-rw-r--r--systemd/db-import@packages.timer.d_time.conf2
-rw-r--r--systemd/make_repo_torrents.service7
-rw-r--r--systemd/make_repo_torrents.timer9
-rw-r--r--systemd/update-lastsync.service7
-rw-r--r--systemd/update-lastsync.timer10
13 files changed, 81 insertions, 0 deletions
diff --git a/cron-jobs/update-lastsync b/cron-jobs/update-lastsync
new file mode 100755
index 0000000..799c761
--- /dev/null
+++ b/cron-jobs/update-lastsync
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+. "$(dirname "$(readlink -e "$0")")/../config"
+date -u +'%s' > "${FTP_BASE}/lastsync"
diff --git a/systemd/db-cleanup.service b/systemd/db-cleanup.service
new file mode 100644
index 0000000..669f87e
--- /dev/null
+++ b/systemd/db-cleanup.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Clean up old files
+
+[Service]
+Type=oneshot
+User=repo
+ExecStart=/opt/dbscripts/cron-jobs/db-cleanup
diff --git a/systemd/db-cleanup.timer b/systemd/db-cleanup.timer
new file mode 100644
index 0000000..8a1c5da
--- /dev/null
+++ b/systemd/db-cleanup.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Periodic cleaning of old packages
+
+[Timer]
+OnCalendar=Sun,Tue,Thu,Sat *-*-* 14:13:00
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/systemd/db-import@.service b/systemd/db-import@.service
new file mode 100644
index 0000000..884d4af
--- /dev/null
+++ b/systemd/db-import@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=db-import %I
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+Type=oneshot
+User=repo
+Environment=DBSCRIPTS_CONFIG=/etc/dbscripts/config.local.%I
+ExecStart=/usr/bin/db-import-pkg %I
+
+PrivateTmp=true
diff --git a/systemd/db-import@.timer b/systemd/db-import@.timer
new file mode 100644
index 0000000..77570d6
--- /dev/null
+++ b/systemd/db-import@.timer
@@ -0,0 +1,8 @@
+[Unit]
+Description=Daily db-import %I
+
+[Timer]
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/systemd/db-import@archlinux32.timer.d_time.conf b/systemd/db-import@archlinux32.timer.d_time.conf
new file mode 100644
index 0000000..028665c
--- /dev/null
+++ b/systemd/db-import@archlinux32.timer.d_time.conf
@@ -0,0 +1,2 @@
+[Timer]
+OnCalendar=*-*-* 08:13:00
diff --git a/systemd/db-import@archlinuxarm.timer.d_time.conf b/systemd/db-import@archlinuxarm.timer.d_time.conf
new file mode 100644
index 0000000..455b0bc
--- /dev/null
+++ b/systemd/db-import@archlinuxarm.timer.d_time.conf
@@ -0,0 +1,2 @@
+[Timer]
+OnCalendar=*-*-* 16:13:00
diff --git a/systemd/db-import@community.timer.d_time.conf b/systemd/db-import@community.timer.d_time.conf
new file mode 100644
index 0000000..3ec5e02
--- /dev/null
+++ b/systemd/db-import@community.timer.d_time.conf
@@ -0,0 +1,2 @@
+[Timer]
+OnCalendar=*-*-* 04:13:00
diff --git a/systemd/db-import@packages.timer.d_time.conf b/systemd/db-import@packages.timer.d_time.conf
new file mode 100644
index 0000000..2561a96
--- /dev/null
+++ b/systemd/db-import@packages.timer.d_time.conf
@@ -0,0 +1,2 @@
+[Timer]
+OnCalendar=*-*-* 00:13:00
diff --git a/systemd/make_repo_torrents.service b/systemd/make_repo_torrents.service
new file mode 100644
index 0000000..fc084ee
--- /dev/null
+++ b/systemd/make_repo_torrents.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Create pacman2pacman torrent files
+
+[Service]
+Type=oneshot
+User=repo
+ExecStart=/opt/dbscripts/cron-jobs/make_repo_torrents
diff --git a/systemd/make_repo_torrents.timer b/systemd/make_repo_torrents.timer
new file mode 100644
index 0000000..9d02cb4
--- /dev/null
+++ b/systemd/make_repo_torrents.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Periodic creation of pacman2pacman torrent files
+
+[Timer]
+OnCalendar=hourly
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/systemd/update-lastsync.service b/systemd/update-lastsync.service
new file mode 100644
index 0000000..33abd45
--- /dev/null
+++ b/systemd/update-lastsync.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Update ${FTP_BASE}/lastsync
+
+[Service]
+Type=oneshot
+User=repo
+ExecStart=/opt/dbscripts/cron-jobs/update-lastsync
diff --git a/systemd/update-lastsync.timer b/systemd/update-lastsync.timer
new file mode 100644
index 0000000..428c0e2
--- /dev/null
+++ b/systemd/update-lastsync.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=Periodic update of ${FTP_BASE}/lastsync
+
+[Timer]
+OnCalendar=*-*-* *:00/10:00
+AccuracySec=1us
+Persistent=true
+
+[Install]
+WantedBy=timers.target