# Long-running work Commands have three modes. | Mode | Behaviour | Limit | |---|---|---| | `wait` | The call returns the result | 60 s by default, 3,600 s at most | | `stream` | Output arrives as it happens | None | | `detach` | Returns at once, and you check later | None | `harebox exec` streams by default, and exits with the remote command's own code. ```sh harebox new --name long harebox exec current -- echo streamed CMD=$(harebox exec current --detach -- sleep 1 | jq -r .id) harebox exec current "$CMD" --status harebox history current ``` ## Always-on services Sleep needs real idleness, so a service with traffic stays awake. To keep one running regardless, set `--sleep never`. ```sh harebox new --name always --sleep never harebox set current --sleep auto ``` Programs started by hand survive sleep, but not a stop. For a service that must come back after a stop, make it a systemd unit. ## Timers Cron and timers inside a VM don't fire while it sleeps. Use a schedule, which runs outside it: ```sh harebox new --name timed harebox schedule new --action wake --cron "0 9 * * 1" --target "$(cat .harebox/current)" ```