From d8f757ee89c46c2aab73fa07852b21259210ce02 Mon Sep 17 00:00:00 2001 From: Zeus Date: Sun, 22 Feb 2026 13:33:31 +0000 Subject: [PATCH] feat: add cron job setup for automated notification auditing - scripts/setup-cron.sh: outputs cron job JSON for agents - SKILL.md: documents cron setup and verification steps - Runs twice daily (11:00 + 15:00 CET) with 6h stale threshold --- docs/SKILL.md | 56 ++++++++++++++++++++++++++++++++++++++++++ scripts/setup-cron.sh | 57 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100755 scripts/setup-cron.sh diff --git a/docs/SKILL.md b/docs/SKILL.md index daa88c7..17e0824 100644 --- a/docs/SKILL.md +++ b/docs/SKILL.md @@ -152,3 +152,59 @@ argus escalate resolve --by WHO --resolution "..." - If not relevant: `argus notif dismiss "Not my area"` 4. **Audit**: `argus notif audit` (escalates stale items) 5. **Log**: `argus activity log triage "Processed 5 notifications"` + +--- + +## Cron Jobs (Automated Auditing) + +Set up cron jobs to automatically audit stale notifications twice daily. + +### Step 1: Add Cron Jobs + +Use the OpenClaw `cron` tool to add these jobs: + +**Morning Audit (11:00 CET):** +```json +{ + "name": "argus-audit-morning", + "schedule": {"kind": "cron", "expr": "0 10 * * *", "tz": "Europe/Berlin"}, + "payload": { + "kind": "agentTurn", + "message": "Run notification audit: ARGUS_BACKEND=tea argus notif audit --stale-hours 6. If escalations created, summarize them briefly." + }, + "sessionTarget": "isolated", + "delivery": {"mode": "announce"} +} +``` + +**Afternoon Audit (15:00 CET):** +```json +{ + "name": "argus-audit-afternoon", + "schedule": {"kind": "cron", "expr": "0 14 * * *", "tz": "Europe/Berlin"}, + "payload": { + "kind": "agentTurn", + "message": "Run notification audit: ARGUS_BACKEND=tea argus notif audit --stale-hours 6. If escalations created, summarize them briefly." + }, + "sessionTarget": "isolated", + "delivery": {"mode": "announce"} +} +``` + +### Step 2: Verify Cron Jobs + +Check that the jobs are registered: +```bash +# Via cron tool +cron list +``` + +Expected output should show `argus-audit-morning` and `argus-audit-afternoon`. + +### What the Audit Does + +- Checks all pending notifications older than 6 hours +- Creates escalations for stale items +- Reports summary back to your channel + +Adjust `--stale-hours` based on your responsiveness requirements. diff --git a/scripts/setup-cron.sh b/scripts/setup-cron.sh new file mode 100755 index 0000000..9db90f6 --- /dev/null +++ b/scripts/setup-cron.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# +# Setup Argus cron jobs for notification auditing +# Run this after installing Argus to enable automatic stale notification escalation +# +set -e + +AGENT_NAME="${1:-$(whoami)}" +STALE_HOURS="${2:-6}" + +echo "╔════════════════════════════════════════╗" +echo "║ Argus Cron Job Setup ║" +echo "╚════════════════════════════════════════╝" +echo +echo "Agent: $AGENT_NAME" +echo "Stale threshold: ${STALE_HOURS}h" +echo + +# This script outputs the cron job JSON for agents to add via OpenClaw cron tool +cat << EOF +Add these cron jobs using the OpenClaw cron tool: + +──────────────────────────────────────────────────────────────── +CRON JOB 1: Morning Audit (11:00 CET) +──────────────────────────────────────────────────────────────── +{ + "name": "argus-audit-morning", + "schedule": {"kind": "cron", "expr": "0 10 * * *", "tz": "Europe/Berlin"}, + "payload": { + "kind": "agentTurn", + "message": "Run notification audit: ARGUS_BACKEND=tea argus notif audit --stale-hours ${STALE_HOURS}. If escalations created, summarize them briefly." + }, + "sessionTarget": "isolated", + "delivery": {"mode": "announce"} +} + +──────────────────────────────────────────────────────────────── +CRON JOB 2: Afternoon Audit (15:00 CET) +──────────────────────────────────────────────────────────────── +{ + "name": "argus-audit-afternoon", + "schedule": {"kind": "cron", "expr": "0 14 * * *", "tz": "Europe/Berlin"}, + "payload": { + "kind": "agentTurn", + "message": "Run notification audit: ARGUS_BACKEND=tea argus notif audit --stale-hours ${STALE_HOURS}. If escalations created, summarize them briefly." + }, + "sessionTarget": "isolated", + "delivery": {"mode": "announce"} +} + +──────────────────────────────────────────────────────────────── + +To add via CLI (if available): + openclaw cron add '' + +Or via the cron tool in your session. +EOF