The basics of scheduling an agent
Cron runs a command at fixed times. Point it at the agent CLI and it becomes a reliable worker: the same task every day, with logs, without you touching it. The recipes below use the agent’s own cron scheduling as well as plain system cron.
Recipe 1 — daily summary at 08:00
0 8 * * * remoteagent run "summarise yesterdays work and pending todos into docs/daily.md"
# writes a dated summary; append >> cron-agent.log 2>&1 to keep a log
Recipe 2 — weekly cost report, Monday 09:00
0 9 * * 1 remoteagent run "read the audit log, list token spend per day and flag the 3 most expensive tasks"
Recipe 3 — nightly backup check
30 2 * * * remoteagent run "verify the last backup exists and is not empty; write a one-line result to backup-check.log"
Rules that keep cron safe
- Run scheduled jobs with the same secure mode rules as interactive ones.
- Cap spend: a nightly job can silently burn budget — combine cron with a daily spend cap.
- Log everything: append
>> log 2>&1and read the logs with the live log view. - Never hard-code credentials in the cron line; the agent reads its own config.
Troubleshooting quiet failures
A cron job that fails says nothing. Check the log first, then test the exact command by hand. If the agent exits immediately, the usual suspects are a missing login, a policy rule that blocks the tool, or a spend cap at zero — the same list as the offline-agent checklist.