SSQZ/atlasDocs
Archives

Snapshots

One archive can hold many versions of the same folder. Each sqz a adds a snapshot, stores only the data that is new, and leaves every earlier snapshot restorable.

Add a snapshot#

sqz a [mode] [-j N] <file-or-folder> <archive.sqz>
sqz a C:\data data.sqz

If the archive does not exist yet, sqz a creates it. The mode applies to the new data only; blocks already in the archive are left as they are.

How unchanged data is found#

Every file is cut into pieces at points chosen by its content, and each piece gets a BLAKE3 fingerprint. A piece that is already in the archive, from any earlier snapshot or any other file, is pointed to instead of stored again. Because the cut points follow the content, an edit in the middle of a file only changes the pieces around it.

A file whose size and modification time match the previous snapshot is still read and hashed before its pieces are reused. That catches an edit that kept the same length and time, at the cost of reading unchanged files.

Restore any snapshot#

sqz l data.sqz                              # shows the snapshots
sqz x -s 1 data.sqz C:\as-it-was            # the oldest
sqz x -s 3 --file docs/plan.txt data.sqz C:\plan-v3
sqz t -s 2 data.sqz

Snapshots are numbered from 1, the oldest. Without -s, commands use the latest.

Archives with many snapshots#

Each append stores its snapshot as changes against the previous one and writes only the index data it adds. The archive goes back to a full index after 16 of these, or sooner if the chain would outgrow a full one. In practice:

100 snapshots of a 20,000-file folderFull index each timeCurrent format
Archive size219 MB18.6 MB
One append13.4 s0.7 s
Memory to restore one file590 MiB21 MiB

Appending to archives with very many small files is also fast: a 1%-changed append of 1,000,000 files takes about 15 seconds. Opening costs about 400 bytes of memory per file, appending about 860.

If an append is interrupted#

An append writes new blocks, then an index, then a new footer at the end of the file. Until the footer is complete, readers use the previous one, so a crash, power cut or full disk during an append leaves the previous snapshot readable, and the next sqz a recovers. This is tested by tearing an append at every byte.

If an index inside a chain is damaged, readers fall back to the last complete state with a warning, and sqz a refuses to append to that archive.

Removing old snapshots#

Archives keep every snapshot; there is no way to delete one from a .sqz. If you want retention rules (keep the last 7 daily, 4 weekly and so on) and space reclaimed from old versions, use SQZ Backup, which is built for that.

Older archives#

New snapshots can only be added to archives in the current format (v7). SQZ still reads older archives, but refuses to append to them before changing anything. To continue one, extract it into a new folder and create a new v7 archive. See Format and compatibility.