SSQZ/atlasDocs
Archives

Create and extract archives

A .sqz archive is one file that holds a folder (or a single file) and any number of snapshots of it. This page covers creating, testing, listing and extracting.

Create#

sqz c [mode] [-j N] [--block MiB] <file-or-folder> <archive.sqz>

Examples:

sqz c C:\data data.sqz                  # default mode: --max
sqz c --balanced -j 4 C:\data data.sqz  # everyday mode, 4 threads
sqz c --fast ~/projects projects.sqz    # quickest

The new archive is written under a temporary name and appears under its real name only when it is complete, so an interrupted run never leaves a half-written .sqz. SQZ refuses to replace an existing file.

What gets stored#

Files and their contents, folders (including empty ones), symlinks (recorded, never followed), hard links, permission bits and modification times to the sub-second. Not stored yet: file owners, ACLs, extended attributes and sparse regions. Sockets, devices and names that are not valid UTF-8 are skipped with a warning. See Known limits.

Test#

sqz t data.sqz
sqz t -s 2 data.sqz                     # one snapshot
sqz t --file docs/report.txt data.sqz   # one file

Testing decodes everything and checks every chunk and every file against its BLAKE3 digest, exactly as extraction does, but writes nothing. Run it after copying an archive to another disk or before deleting the originals.

List#

sqz l data.sqz
sqz l -s 1 data.sqz

Lists the files in a snapshot (the latest by default) and the snapshots in the archive.

Extract#

sqz x [-s N] [-j N] [--file PATH]... <archive.sqz> <output-folder>
sqz x data.sqz C:\restore
sqz x -s 1 data.sqz C:\old-snapshot
sqz x --file docs/report.txt --file docs/budget.xlsx data.sqz C:\two-files

Checks before anything is written#

Before writing a single file, extraction checks the destination and stops with one error, leaving nothing behind, when:

The error names up to five of the paths involved. Use --file to leave out the ones that clash, or extract into a different folder.

The order of restoring#

Regular files come first, each verified and then given its real name, time and permissions. Then folders, hard links and symlinks, and finally the times and permissions of the folders, deepest first. Symlinks that would point outside the output folder (absolute targets, .. that climbs out, or targets with \ or :) are skipped with a warning. setuid, setgid and sticky bits are never granted. On Windows, folder times are not restored and symlinks are created only if your account may create them.

Long paths on Windows#

Paths longer than Windows' old 260-character limit restore normally.

Extract to a new, empty folder#

Restores go somewhere new. SQZ never overwrites, and publishing each verified file needs a drive that supports hard links. Keep the output folder under your control and do not change it while extraction runs.

Exit codes#

CodeMeaning
0Success; every file verified.
1An error: damage found, a destination conflict, a missing --file path, an archive from a newer format, and so on. The message says which.
2The command line was not understood; the help is printed.