Custom systemd units
Auto-update timers. Each runs every 30 minutes. Unit files are in /etc/systemd/system/.
| Unit | Does |
|---|---|
update-notes.service + .timer | Pulls the notes repo and rebuilds/deploys to /var/www/notes |
song-rating-pull.service + .timer | git pull of <GITHUB_USER>/<SONG_REPO> into /var/www/song_rating |
Typical timer pattern
Note
This is a generic example, not copied from the server. Check the real files with
systemctl cat update-notes.timer.
# <name>.timer
[Unit]
Description=Run <name> every 30 minutes
[Timer]
OnBootSec=2min
OnUnitActiveSec=30min
Persistent=true
[Install]
WantedBy=timers.targetCommands
systemctl list-timers update-notes.timer song-rating-pull.timer
sudo systemctl start update-notes.service # run now
journalctl -u update-notes.service -n 50
sudo systemctl daemon-reload # after editing unit files
sudo systemctl enable --now <name>.timerBack: 00 - Overview