nightly.sh
Shell · 10 lines · 616 B
#!/usr/bin/env bash
# Example nightly maintenance for Big Brain: schedule it with cron, a systemd user timer, launchd
# or Task Scheduler. `brain maintain` updates the index, has the librarian (config `model`) review
# stale entries and check related entries for contradictions, and lists broken links and duplicates.
# With LM Studio it starts the server and loads the model only if needed, then puts it back.
set -uo pipefail
printf '%s maintain\n' "$(date '+%F %T')"
# Services often run without ~/.cargo/bin on PATH.
BRAIN="$(command -v brain || echo "$HOME/.cargo/bin/brain")"
exec "$BRAIN" maintain --limit 40