Scheduling

The RegScale CLI can run itself on a schedule. You describe the commands you
already run by hand — an Axonius pull, a Wiz sync, a JCAM export — in a
jobs.yaml file, give each one a cron schedule, and the CLI runs them, records
the outcome, and emails you when one fails.

This is the regscale jobs command group.

🚧

Beta

The jobs.yaml file format and the command surface are stable. Some advanced
deployment scenarios are still being hardened.

Which document do I need?

I want to…Read
Get one command running on a schedule, right nowQuickstart
Know every jobs.yaml field, environment variable, and defaultConfiguration
Write the cron expression for "every Monday at 2am Eastern"Schedules and cron
Run this in Docker, Kubernetes, systemd, host cron, or WindowsDeployment
Schedule a command from the interactive terminal UI instead of a fileScheduling from the TUI
Get email when a job failsConfiguration → Email alerting
Work out why a job did not run, or did not run when expectedFAQ and troubleshooting

The pages in this section are the operator-facing guides. The engineering
reference for the same feature — internal locking, state file formats,
invariants — is docs/scheduled-jobs.md in the regscale-cli repository.

The shape of it

                   jobs.yaml                  ~/.regscale/
              ┌──────────────────┐      ┌──────────────────────────┐
              │ name: wiz-nightly│      │ jobs_state.json          │  what ran, when
              │ command: [...]   │      │ job_runs/<job>.jsonl     │  run history
              │ schedule: 0 2 * *│      │ job_logs/<job>-<id>.log  │  per-run output
              └────────┬─────────┘      └──────────────────────────┘
                       │                              ▲
                       ▼                              │
        regscale jobs daemon  ──── runs ────►  regscale <your command>
        (or run-due, from cron)                (an isolated subprocess)

Three things to hold on to:

  1. A job is just a RegScale CLI command. Anything you can type as
    regscale axonius sync_assets --plan_id 12 can be a job. Nothing new to
    learn about the command itself.
  2. Credentials never go in jobs.yaml. They stay in init.yaml or
    environment variables, exactly where they are now. The CLI refuses to load a
    jobs file that contains one — see
    Configuration → No secrets in jobs.yaml.
  3. Two ways to run the schedule. Either a long-lived regscale jobs daemon
    (good for a container), or regscale jobs run-due triggered by a scheduler
    you already have (good for host cron or a Kubernetes CronJob). Pick one —
    see Deployment.

Command summary

regscale jobs validate          # is my jobs.yaml valid?
regscale jobs list              # what is scheduled, when does it next run, how did it last go?
regscale jobs run <name>        # run one job now, ignoring its schedule
regscale jobs run-due           # run whatever is due, then exit  (external-scheduler mode)
regscale jobs daemon            # run the scheduler loop in the foreground (container mode)
regscale jobs history <name>    # show recent runs for one job

Full option-by-option detail: Configuration → Command reference.


Did this page help you?