Skip to content

Configure daily cron job for automated hardware health checks #6

@dirkenglund

Description

@dirkenglund

Task

Set up the daily automated hardware health check on the lab machine.

Steps

  1. Make the script executable:
    chmod +x scripts/daily_health_check.sh
  2. Add to crontab:
    crontab -e
    # Add this line (runs at 8am daily):
    0 8 * * * /path/to/M2_Tracking/scripts/daily_health_check.sh
  3. Results are saved to results/health_YYYY-MM-DD_HHMM.log and .xml

What it does

  • Runs pytest tests/test_hardware_health.py -m daily
  • Asserts: pressure < 1e-5 mbar, temperature < 4.5 K, laser power within range
  • Logs all readings to InfluxDB (visible in Grafana)
  • Exits nonzero on failure (can be wired to email/Slack alerts)

Optional: Email notification on failure

Add to crontab:

0 8 * * * /path/to/daily_health_check.sh || mail -s "M2 Health Check FAILED" team@mit.edu < /path/to/results/latest.log

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions