#!/usr/bin/env bash
set -u
project_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
log_dir="$project_root/outputs/logs"

printf 'Watchdog and supervisors:\n'
pgrep -af 'baseline_watchdog|download_ecmwf_baseline|build_monthly_baseline|dr_gcm.monthly' || true
printf '\nWatchdog PID file:\n'
cat "$log_dir/baseline_watchdog.pid" 2>/dev/null || printf 'absent\n'
printf '\nRecent watchdog log:\n'
tail -n 20 "$log_dir/baseline_watchdog.log" 2>/dev/null || true
