#!/usr/bin/env bash # Read-only status for the pilot-gated soil-moisture workflow. set -u -o pipefail project_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) log_dir="$project_root/outputs/logs" for name in monitor download; do pid_file="$log_dir/ecmwf_soil_moisture_${name}.pid" printf '%s process:\n' "$name" if [[ -f "$pid_file" ]]; then pid=$(cat "$pid_file") ps -o pid,ppid,pgid,sid,etime,stat,args -p "$pid" || true else printf 'PID file absent\n' fi done printf '\nCompleted soil-moisture files:\n' find -L "$project_root/data/ecmwf/soil_moisture" -maxdepth 1 -type f \ -name 'ecmwf_seas51_*_soil_moisture.nc' -printf '.' 2>/dev/null | wc -c printf '\nRecent monitor log:\n' tail -20 "$log_dir/ecmwf_soil_moisture_monitor.log" 2>/dev/null || true printf '\nRecent download log:\n' tail -30 "$log_dir/ecmwf_soil_moisture_download.log" 2>/dev/null || true