> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://rivet.chrisboulton.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://rivet.chrisboulton.com/_mcp/server.

# Scheduling agent runs

> Run rivet run from a systemd timer.

`rivet run` runs once and exits; there is no long-running daemon. Use a systemd timer to run it periodically. The repository includes sample units in `examples/distribution/`: `rivet-agent.service` and `rivet-agent.timer`.

With Rivet installed at `/usr/bin/rivet` (or the unit's `ExecStart` edited to match your path), copy both units to `/etc/systemd/system`, write [`/etc/rivet/agent.hcl`](/operations/agent), and enable the timer:

```sh
sudo systemctl daemon-reload
sudo systemctl enable --now rivet-agent.timer
sudo systemctl list-timers rivet-agent.timer
sudo journalctl -u rivet-agent.service
```

The sample service is a oneshot with `UMask=0077` and a 30-minute timeout. The timer first fires two minutes after boot, then 30 minutes after each run finishes, with up to five minutes of random delay so hosts don't all run at once.

Every host follows the environment independently. There's no coordinated rollout: to stage a change, promote it to a smaller environment first. If many hosts use the [compile service](/operations/compile-service), the random delay also keeps it from being overloaded; it answers HTTP 429 when busy.