Mega Mind v0.5.4

nightly.sh

Shell · 15 lines · 795 B
#!/usr/bin/env bash
# Example nightly maintenance for Mega Mind: schedule it with cron, a systemd user timer, launchd
# or Task Scheduler. `mind 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 with a short PATH: also look where the cargo build and the prebuilt download go.
MIND="$(command -v mind || true)"
for c in "$HOME/.local/bin/mind" "$HOME/.cargo/bin/mind"; do
  [ -n "$MIND" ] && break
  [ -x "$c" ] && MIND="$c"
done
MIND="${MIND:-$HOME/.cargo/bin/mind}"
exec "$MIND" maintain --limit 40