Skip to content

Run a flow on a schedule

Run a flow every night, every hour or on weekdays, without remembering to start it.

You need: a project with a flow, and the daemon. Only the daemon starts flows on a schedule; truss run ignores schedules.

.truss/flows/backup.yaml
version: "1"
flow:
name: backup
on:
schedule:
- cron: "0 2 * * *" # every day at 02:00
steps:
- id: copy
run: rsync -a ~/photos/ /mnt/backup/photos/

A cron time has five fields: minute, hour, day of month, month, day of week.

Cron Runs
0 * * * * every hour
*/15 * * * * every 15 minutes
0 2 * * * every day at 02:00
0 9 * * 1-5 Monday to Friday at 09:00
0 0 1 * * on the 1st of every month at midnight
@daily every day at midnight (@hourly, @weekly, @monthly, @yearly also work)

truss init and truss flows new can write the schedule from plain words (“every day at 02:00”). All cron forms are in the triggers reference.

A schedule can also say which time zone it means and what to do about missed times:

on:
schedule:
- cron: "0 9 * * 1-5"
timezone: Europe/Berlin # default: this machine's time zone
missed: run # default: skip
$ truss validate backup # check the file
$ truss daemon start # start the background service
$ truss register backup # or: truss register --all
registered backup (/home/me/project/.truss/flows/backup.yaml)
schedule 0 2 * * *: next run 2026-11-02 02:00:00
$ truss schedules # every schedule and when it runs next

Edit the file later and save: the daemon notices within a second. You do not register it again.

To keep schedules running after a restart, start the daemon at login, once:

$ truss daemon install

A laptop sleeps and is switched off. By default TRUSS does not run a late job when you open the lid at 11:00: a missed 09:00 run is recorded as skipped.

missed When a planned time passed while the machine was off or the daemon stopped
skip (default) Nothing runs. The history shows a skipped run with the planned time.
run One catch-up run starts as soon as the daemon is back, however many times were missed.

If a run is still going when the next one is due, flow.overlap decides:

flow:
name: sync
overlap: skip # queue (default) | skip | parallel

queue waits for the first run to end, skip drops the new one, parallel starts both.

$ truss schedules # what runs next
$ truss runs backup # the latest runs of this flow
$ truss runs show last # steps, exit codes, a timeline
$ truss logs <run-id> # the log of one run
$ truss pause backup # stop its schedules for now
$ truss resume backup # and start them again

Get notified when a run fails, so you do not have to look.

  • truss schedules does not list it: the flow is not registered (truss register backup).
  • It lists it as paused: truss resume backup.
  • The daemon is not running: truss daemon status.
  • It ran, but the command failed under the daemon only: the daemon can have a shorter PATH than your terminal. See Troubleshooting.