commit 6139c367b0fd2ef1e79a26cac1306c700db0ca3e
parent 28d9731bbd2db24a31c8f3ebdb85c1605a4aedb1
Author: pyratebeard <root@pyratebeard.net>
Date: Sat, 11 Apr 2026 22:52:37 +0100
feat: adds templates for cron and systemd scheduling
Diffstat:
4 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
@@ -2,8 +2,23 @@
## usage
```
-python3 -m venv venv
-source venv/bin/activate
+python3 -m venv virtualenv
+source virtualenv/bin/activate
pip install -r requirements.txt
./wmt.py
```
+
+## schedule
+### cron
+* edit path to `wmt.py` in _cron/wmt.cron_
+* copy contents of _cron/wmt.cron_ into user crontab
+
+### systemd
+* edit path to `wmt.py` in _systemd/wmt.service_
+* copy _systemd/wmt.{timer,service}_ to _$HOME/.config/systemd/user_ (if this dir does not exist you will need to create it)
+* enable
+```
+systemd --user daemon-reload
+systemd --user enable wmt.service
+systemd --user enable wmt.timer
+```
diff --git a/cron/wmt.cron b/cron/wmt.cron
@@ -0,0 +1,2 @@
+# weeklymusictoot
+0 17 * * fri /path/to/wmt.py
diff --git a/systemd/wmt.service b/systemd/wmt.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=weeklymusictoot
+
+[Service]
+ExecStart=/usr/bin/python3 /path/to/wmt.py
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/wmt.timer b/systemd/wmt.timer
@@ -0,0 +1,10 @@
+[Unit]
+Description=weeklymusictoot
+
+[Timer]
+OnCalendar=Fri * 17:00:00
+Unit=wmt.service
+Persistent=true
+
+[Install]
+WantedBy=timers.target