Automation & DevOps

    Run Reproducible Batch Jobs from One JSON Config

    A folder full of one-off scripts is a maintenance trap. Move your FolderManifest routine into a single JSON config: reviewable, identical on every machine, and reduced to one pass/fail result.

    Published June 28, 202611 min read
    Mehrab Ali

    Author

    Mehrab Ali

    Data Scientist, Researcher & Entrepreneur

    Founder of ARCED Foundation, ARCED International, and Solutions of Things Lab (SoTLab). Built FolderManifest to help teams protect file integrity and stay audit-ready.

    Last updated June 28, 2026

    Quick answer

    To run many FolderManifest jobs from one file, write a JSON config with a jobs array and run foldermanifest --config jobs.json. Each job runs in order and the batch returns the worst exit code among the jobs (0 clean, 1 drift), so the whole run reduces to a single pass-or-fail signal for Task Scheduler or CI.

    • List every job in one JSON --configgenerate, verify, duplicates, mixed freely.
    • Run them all with foldermanifest --config jobs.json.
    • The batch returns the worst exit code — one pass/fail signal.
    • It is data, not code — reviewable in a pull request, identical everywhere.

    Why a config beats a script

    The natural way to automate several folders is a batch file with one command per line. It works — until the quoting drifts, a path with a space breaks on one machine, and nobody can tell what the script actually checks without reading it line by line. A --config file is the boring, durable alternative: it’s data, not code.

    With the FolderManifest CLI, a single JSON file describes every job. There’s no shell to escape, the same file runs identically on every machine, and a teammate can review it in a pull request the way they’d review config — because that’s what it is.

    Anatomy of a config file

    The file is a jobs array. Each entry names a cmd, the paths it acts on, and that command’s own flags. Different command types live happily in the same config:

    jobs.json
    {
      "jobs": [
        { "cmd": "verify",     "paths": ["C:\\Backups\\Invoices"],  "manifest": "D:\\baselines\\invoices.json" },
        { "cmd": "verify",     "paths": ["C:\\Backups\\Contracts"], "manifest": "D:\\baselines\\contracts.json" },
        { "cmd": "generate",   "paths": ["C:\\Deliverables\\2026"],  "format": "json", "out": "D:\\baselines\\deliverables-2026" },
        { "cmd": "duplicates", "paths": ["E:\\Media"],                 "report": "D:\\reports\\media-dupes" }
      ]
    }

    This one config verifies two backups against their baselines, refreshes a manifest for the current deliverables, and produces a duplicate report for a media drive — in a single, reviewable place.

    Job fields reference

    Every job is an object. cmd and paths are the constants; the rest mirror the command-line flags for that command:

    FieldApplies toPurpose
    cmdAll jobsThe command: verify, generate, duplicates, sheet-dedupe, …
    pathsAll jobsThe folders or files the command acts on
    manifestverifyThe baseline JSON/HTML to compare against
    formatgenerateOutput manifest format (json, html, markdown)
    outgenerate, sheet-dedupeCustom output path for the result
    reportAny result commandWrite a branded HTML report to this path

    Running the batch

    One command runs every job in order:

    Command Prompt
    foldermanifest --config jobs.json

    Add --json for machine-readable per-job results you can pipe into a log or a dashboard. The jobs run top to bottom, each with its own flags exactly as if you’d typed them by hand.

    One exit code for the whole run

    A batch is only useful if you can act on its result without parsing pages of output. FolderManifest collapses the run to a single exit code — the worst outcome among the jobs:

    Exit codeMeaningScheduler / CI action
    0Every job clean (no drift)Pass — stay silent
    1At least one verify detected driftFail — alert
    2No active license; files untouchedFail — renew
    3Usage error / malformed jobFail — fix the config

    So your scheduler or pipeline line stays trivial: run the config, and branch on non-zero. A clean run is silent; a problem run is one alert.

    Schedule it on Windows

    To run the batch every night, point a Windows Task Scheduler job at the config command from an elevated Command Prompt:

    Command Prompt (elevated)
    schtasks /Create ^
      /TN "FolderManifest Nightly Batch" ^
      /TR "foldermanifest --config C:\ops\jobs.json" ^
      /SC DAILY /ST 02:00 /RL HIGHEST /F

    The full Task Scheduler walkthrough — including running unattended with no one logged in — is in the automate folder verification guide.

    Wiring it into CI

    Because the exit code already means pass/fail, a CI step needs no extra glue. Drop the config into the repo and call it — the build fails automatically when a generated artifact drifts from its baseline:

    .github/workflows/integrity.yml (excerpt)
    - name: Verify generated artifacts
      run: foldermanifest --config ci/integrity-jobs.json --json

    Same file, same behaviour as your scheduled job — which is the whole point. A drift gate that catches unexpected changes before deploy is also covered in the CI/CD checksum validation guide.

    Make it version-controlled

    The real payoff is treating these routines like the infrastructure they are. Commit jobs.json to your ops repo and every change is reviewed, every machine runs the identical routine, and “what do we check?” has a single, diffable answer. Need to watch a new folder? Add three lines, open a pull request — not a new scheduled task on a server nobody remembers.

    The full flag reference for every command lives in the CLI documentation.

    Turn your routine into reviewable config

    The CLI — including --config batch runs and --json output — ships with the 7-day trial and every lifetime license.

    Frequently asked questions

    How do I run multiple FolderManifest jobs from one config file?
    Write a JSON file with a jobs array, one entry per command, then run foldermanifest --config jobs.json. Every job runs in order and the batch returns a single exit code: the worst result among the jobs, so the run reduces to one pass-or-fail signal.
    What can go in a --config file?
    A JSON object with a jobs array. Each job names a command (generate, verify, duplicates, sheet-dedupe, and so on), the paths it acts on, and that command's flags such as format, manifest, out, or report. One config can mix command types freely.
    Which commands can a job use?
    Any result command works in a config: generate, verify, checksum, duplicates, metadata, compare-files, compare-folders, sheet-dedupe, and sheet-analyze. You can combine a verification job, a manifest refresh, and a duplicate report in the same file.
    What exit code does a batch return?
    The worst result across all jobs. If every job is clean you get 0; if any verify detects drift you get 1; a missing license is 2 and a malformed job is 3. Your scheduler or CI step still reduces to a single did-anything-fail check.
    Do the jobs run in order, and does one failure stop the rest?
    Jobs run top to bottom in the order listed. A drift result does not abort the batch; every job runs and the worst outcome is reported at the end. That way a single config gives you one complete picture per run.
    Why use a config file instead of a batch script?
    Because it is data, not code. A JSON config is reviewable in a pull request, identical on every machine, and free of shell-quoting and path-escaping bugs. You commit it to your ops repo and the routine becomes version-controlled and reproducible.
    Can I get per-job results instead of just the exit code?
    Yes. Add --json to the command and FolderManifest prints structured per-job results you can pipe into a log, a dashboard, or a CI annotation. The single exit code still summarises the whole run for simple pass-or-fail gating.
    Can I run a config on a schedule?
    Yes. Point a Windows Task Scheduler job at foldermanifest --config jobs.json and it runs the whole batch unattended. See the automation guide for the Task Scheduler setup, including running without anyone logged in.
    Can I use a config in CI?
    Yes. Run foldermanifest --config jobs.json --json as a pipeline step. The JSON output is easy to parse and the exit code fails the build automatically when a job reports drift, with no extra glue between the command and the gate.
    Is the --config feature a separate purchase?
    No. Batch --config runs, --json output, and the rest of the CLI ship inside the FolderManifest Windows app and are included with the trial and every paid license at no extra cost.

    Related: Automate folder verification with the CLI · Bulk-dedupe from the terminal