summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-04-17 01:59:31 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-04-17 01:59:31 -0600
commit50cd710163edb398e72d56414d956607919a805b (patch)
tree6c26892259971ade48fef6160a93712c913363a3
parentf5d2c5668d7c79ff24afebe36a1f9879f2eb3d5f (diff)
imworkingon: Add a systemd unit to flush the cache at midnight
-rw-r--r--aux/www-refresh.service8
-rw-r--r--aux/www-refresh.timer12
2 files changed, 20 insertions, 0 deletions
diff --git a/aux/www-refresh.service b/aux/www-refresh.service
new file mode 100644
index 0000000..7336f1c
--- /dev/null
+++ b/aux/www-refresh.service
@@ -0,0 +1,8 @@
+[Unit]
+Description="Website update cron job"
+
+[Service]
+Type=oneshot
+Environment=LANG=en_US.UTF-8
+WorkingDirectory=~/www
+ExecStart=sh -c 'rm -rf .http-cache && make'
diff --git a/aux/www-refresh.timer b/aux/www-refresh.timer
new file mode 100644
index 0000000..d507e2f
--- /dev/null
+++ b/aux/www-refresh.timer
@@ -0,0 +1,12 @@
+[Unit]
+Description=Website update cron job
+
+[Timer]
+Persistent=true
+# somewhere between 4am and 5am MDT (in the summer;
+# between 3am and 4am MST in the winter)
+OnCalendar=*-*-* 10:00:00 UTC
+RandomizedDelaySec=1h
+
+[Install]
+WantedBy=default.target