add saints
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
# lives at ~/.config/systemd/user/saints.service
|
||||||
|
|
||||||
|
# User-level systemd service to run get_saint_of_the_day.py
|
||||||
|
# Configuration is via ~/.config/saints.env, no in-file path edits needed.
|
||||||
|
# Create that file with one line:
|
||||||
|
# REPO_PATH=/absolute/path/to/this/repo
|
||||||
|
# Then run:
|
||||||
|
# systemctl --user daemon-reload
|
||||||
|
[Unit]
|
||||||
|
Description=Run get_saint_of_the_day.py (profile stats updater)
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
EnvironmentFile=%h/.config/saints.env
|
||||||
|
ExecStartPre=/usr/bin/nm-online -q
|
||||||
|
ExecStartPre=/bin/bash -c 'for i in {1..30}; do getent hosts tildegit.org && exit 0; sleep 1; done; exit 1'
|
||||||
|
ExecStart=/bin/bash -lc 'cd ${REPO_PATH} && uv run get_saint_of_the_day.py'
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# lives at ~/.config/systemd/user/saints.timer
|
||||||
|
|
||||||
|
# User-level systemd timer that "catches up" missed runs if the machine was off.
|
||||||
|
[Unit]
|
||||||
|
Description=Schedule get_saint_of_the_day.py with catch-up if missed
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
# Change this to your desired schedule; examples:
|
||||||
|
# OnCalendar=daily
|
||||||
|
# OnCalendar=Mon..Fri 09:00
|
||||||
|
# See man systemd.time for syntax.
|
||||||
|
OnCalendar=daily
|
||||||
|
Timezone=America/New_York
|
||||||
|
Persistent=true
|
||||||
|
Unit=saints.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
Reference in New Issue
Block a user