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¶
- Periodically: after every
interval(default 50) processed assets - 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.tmp → flush + fsync → os.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¶
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/excludedassets are skipped - If the checkpoint file does not exist, it warns and returns; it is not treated as a fatal error
- With
--resumeand existing nodes in the graph, startup succeeds even without-d/-u
Resume Log¶
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.