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
This commit is contained in:
parent
5c951b61ca
commit
d8f757ee89
2 changed files with 113 additions and 0 deletions
|
|
@ -152,3 +152,59 @@ argus escalate resolve <id> --by WHO --resolution "..."
|
|||
- If not relevant: `argus notif dismiss <id> "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.
|
||||
|
|
|
|||
57
scripts/setup-cron.sh
Executable file
57
scripts/setup-cron.sh
Executable file
|
|
@ -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 '<json>'
|
||||
|
||||
Or via the cron tool in your session.
|
||||
EOF
|
||||
Loading…
Add table
Reference in a new issue