Verify a scheduled CLI job

Run a Dosya CLI job with explicit paths, secret, and workspace, preserve JSON and exit evidence, then verify its remote result before success.

Last reviewed

Schedulers provide a sparse environment and may run from an unexpected directory. A reliable Dosya job uses absolute paths, explicit credential isolation, structured output, and a separate verification read.

Four workflow panels show recording scheduler context, verifying identity and workspace, classifying the original exit status, and checking remote state.
The diagram covers recording scheduler context, verifying identity and workspace, classifying the original exit status, and checking remote state. Open full-size screenshot.

Before you start

  • Use the absolute CLI binary and local input path. The default request timeout is 30 seconds; set a positive --timeout only when the operation needs a different bound.
  • Inject DOSYA_API_KEY from the scheduler or assign a private XDG_CONFIG_HOME; there is no --profile option.
  • Pin and verify the intended workspace before changing data.

Steps

  1. At job start, record the UTC time, CLI version, absolute executable, nonsecret job name, and expected workspace. Do not log the secret or full environment.
  2. Run whoami --json with the scheduled credential and reject an unexpected account. Confirm the target workspace through an explicit read.
  3. Invoke the business command with absolute paths, --json, and the approved timeout. Redirect stdout and stderr to separate protected files.
  4. Save the original process status. Classify 3 as auth, 4 as network, 5 as forbidden, 75 as maintenance, and 130 or 143 as cancellation; retry only operations safe to repeat.
  5. Parse the command-specific receipt and extract its resource ID. Check partial batch failures rather than trusting a generic success assumption.
  6. Perform a read-only remote verification for the expected ID, parent, name, size, or deleted state. Mark the schedule successful only after that postcondition matches.
Dosya CLI overview with installation and command references for verify a scheduled cli job.
The CLI overview supplies the installation and command references used by “Verify a scheduled CLI job”. Open full-size screenshot.

Expected result

The scheduler records identity, command receipt, exit status, and a read-only remote postcondition. A local zero exit without the expected remote state cannot become a successful run.

Troubleshooting

It works interactively but not on schedule. Compare executable path, working directory, XDG root, secret injection, and network access.

The job times out. Increase a positive --timeout only after confirming the operation and scheduler deadline permit it.

A mutation has network exit 4. Read remote state before retrying. A transport failure does not prove the server rejected the write.

Was this helpful?

Loading helpfulness results…

Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.

Questions and replies

Ask about the steps in this guide. Questions are reviewed before publication.

Keep account details, credentials and private files out of public questions. Use private support for those.

Loading questions…

    Sign in to your Dosya account to ask a question.

    Check the outcome before you retry

    Use these shared checks when a task needs a second look.