Skip to content

Scheduling

Jacob Centner edited this page Apr 10, 2026 · 2 revisions

Scheduling

Sentinel is designed as a single-run tool triggered externally. Use your system's scheduler (cron, systemd timers, Task Scheduler) to run overnight scans.

cron (Linux/macOS)

crontab -e

Add:

# Run Sentinel at 3am daily
0 3 * * * /home/user/sentinel/.venv/bin/sentinel scan /path/to/repo --skip-judge >> /var/log/sentinel.log 2>&1

# With LLM judge (requires Ollama running)
0 3 * * * /home/user/sentinel/.venv/bin/sentinel scan /path/to/repo >> /var/log/sentinel.log 2>&1

# Incremental scan (faster, only changed files)
0 3 * * * /home/user/sentinel/.venv/bin/sentinel scan /path/to/repo --incremental >> /var/log/sentinel.log 2>&1

systemd timer (Linux)

Create /etc/systemd/system/sentinel.service:

[Unit]
Description=Sentinel overnight scan

[Service]
Type=oneshot
User=youruser
WorkingDirectory=/path/to/repo
ExecStart=/home/user/sentinel/.venv/bin/sentinel scan /path/to/repo
Environment=PATH=/home/user/sentinel/.venv/bin:/usr/local/bin:/usr/bin

Create /etc/systemd/system/sentinel.timer:

[Unit]
Description=Run Sentinel daily at 3am

[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true

[Install]
WantedBy=timers.target

Enable:

sudo systemctl enable --now sentinel.timer

Windows (WSL 2)

If running Sentinel in WSL 2, use a cron job inside WSL:

# Inside WSL:
crontab -e
# Add:
0 3 * * * /path/to/.venv/bin/sentinel scan /path/to/repo >> /var/log/sentinel.log 2>&1

Or use Windows Task Scheduler to invoke WSL:

  1. Open Task Scheduler → Create Basic Task
  2. Trigger: Daily at 3:00 AM
  3. Action: Start a program
  4. Program: wsl.exe
  5. Arguments: -d Ubuntu -- /path/to/.venv/bin/sentinel scan /path/to/repo

Multi-repo scanning

sentinel scan-all ~/project-a ~/project-b ~/project-c \
  --db ~/.sentinel/all.db \
  --skip-judge

All repos scan into a shared database. Use sentinel serve with --db to review them together.

Viewing results

After a scheduled scan:

# Check latest findings
sentinel findings

# Launch web UI to review
sentinel serve /path/to/repo

# Get JSON for scripting
sentinel findings --json-output | jq '.[] | select(.severity == "high")'

Tips

  • Use --incremental for daily scans (faster, only new changes)
  • Use full scans weekly or after major updates
  • Set min_confidence = 0.5 in sentinel.toml to reduce noise in scheduled runs
  • Use sentinel prune --older-than 90 periodically to manage database size
  • Redirect output to a log file for debugging scheduled runs

Clone this wiki locally