Files
Claude 83d8406d1a Add Ollama model auto-updater with systemd timer
ollama pull compares digests server-side so no download happens if
a model is already current. Timer runs monthly offset 2h from kiwix.
install.sh updated to handle all units generically.

https://claude.ai/code/session_012gDnantBmFTWZGCiKyjazx
2026-03-21 23:09:18 +00:00

34 lines
831 B
Bash
Executable File

#!/bin/bash
# Install all local-ai systemd user units and enable timers
set -e
UNIT_DIR="$HOME/.config/systemd/user"
SRC="$(cd "$(dirname "$0")" && pwd)"
mkdir -p "$UNIT_DIR"
for unit in "$SRC"/*.service "$SRC"/*.timer; do
name=$(basename "$unit")
ln -sf "$unit" "$UNIT_DIR/$name"
echo "Linked $name"
done
systemctl --user daemon-reload
for timer in "$SRC"/*.timer; do
name=$(basename "$timer")
systemctl --user enable --now "$name"
echo "Enabled $name"
done
echo ""
systemctl --user list-timers kiwix-update.timer ollama-update.timer
echo ""
echo "Run manually:"
echo " systemctl --user start kiwix-update.service"
echo " systemctl --user start ollama-update.service"
echo ""
echo "Logs:"
echo " journalctl --user -u kiwix-update.service -f"
echo " journalctl --user -u ollama-update.service -f"