Z-Sans can save scan progress to a checkpoint. After an interruption, use --resume to continue from the last breakpoint without rescaming already-processed assets.

Configuration

checkpoint:
  enabled: true    # enable checkpoint saving
  interval: 50     # save after every 50 processed assets
  file: null       # checkpoint file path; null uses <output_dir>/checkpoint.json

When Checkpoints Are Saved

  1. Periodically: after every interval (default 50) processed assets
  2. On stop: triggered by stop() (including normal completion, Ctrl+C, and stopping the task from the Web console)

Atomic Writes

Checkpoints are written atomically: first write path.tmpflush + fsyncos.replace to the target path. Even if the process is force-killed, no truncated or corrupted checkpoint file is left behind.

Checkpoint File Contents

<output_dir>/checkpoint.json (default):

{
  "version": 1,
  "saved_at": 1800000000,
  "seed_domains": ["example.com"],
  "seed_ips": [],
  "seed_ip_ranges": [],
  "metrics": { "..." },
  "nodes": [ { "uid": "domain:example.com", "type": "domain", "value": "...", "source": "manual", "depth": 0, "state": "scanned", "properties": {} } ],
  "edges": [ ["domain:example.com", "ip:93.184.216.34", "resolved"] ],
  "queue": [ { "..." } ]
}

Usage

Scenario 1: Resume after interruption

python main.py -d example.com    # scan interrupted by Ctrl+C
python main.py --resume           # continue from the checkpoint

Scenario 2: Resume and append seeds

python main.py -d example.com --resume   # resume while adding new seeds

Resume rules

  • On resume, all nodes and edges are rebuilt (calling the corresponding asset factory per type)
  • Only assets with state ∈ (new, failed, scanning) are replayed from the queue; scanned / eliminated / excluded assets are skipped
  • If the checkpoint file does not exist, it warns and returns; it is not treated as a fatal error
  • With --resume and existing nodes in the graph, startup succeeds even without -d / -u

Resume Log

Resuming scan from checkpoint, {nodes} assets, {queued} queued

Relationship with Watch Mode

--watch creates a brand-new engine each round and does not use checkpoints. Resume-from-breakpoint only serves the robustness of single command-line scans.