Skip to content

Command x (Extract file(s))

Franco Corbelli edited this page Sep 2, 2023 · 4 revisions

Extract files (including the contents of directories), or extract the whole archive contents if files is omitted. Examples Diff against 7.15

The file names, last-modified date, and permissions or attributes are restored as saved in the archive. If there are multiple versions of a file stored, then only the latest version is extracted (by default). If a stored file has been marked as deleted, then it is not extracted. Existing files are skipped without being overwritten. (Use -force to overwrite).

As files are extracted, the fragment SHA-1 hashes are computed and compared with the stored hashes. The program reports an error in case of mismatches. Blocks are only decompressed up to the last used fragment. If the archive is damaged, then zpaqfranz will extract as much as possible from the undamaged blocks.

As files are extracted, the program reports ? if the file is skipped because it already exists, or = if decompression is skipped with -force because the contents were compared and found to be identical. The date and attributes are still extracted in this case.

Warning: for multipart archive use doublequote, like "z:\thisismybackup-?????"

Switches

-all [N]

Extract all saved versions and not just the latest, including versions where the file is marked as deleted. Each version is shown in a separate numbered directory beginning with 0001/. Absolute paths are first converted to relative paths. In Windows, the : on the drive letter is removed. For example, foo and /foo are shown as 0001/foo. C:/foo and C:foo are shown as 0001/C/foo. The date shown on the root directory of each version is the date of the update. The root directory listing also shows the number of updates and deletions in that version and the compressed size. When a file is deleted, it is shown with the dates and attributes blank with size 0. N selects the number of digits in the directory name. The default is 4.

-f -force

With extract, overwrite existing output files. If the contents differ (tested by comparing SHA-1 hashes), then the file is decompressed and extracted. If the dates or attributes/permissions differ, then they are set to match those stored in the archive.

-key password

This option is required for all commands operating on an encrypted archive.

-to name...

Maybe the MOST IMPORTANT switch for extract
Rename internal files to external names. When files is empty, prefix the extracted files with the first name in names, inserting / if needed and removing : from drive letters.
Extracting without -to will write in the same place of original files (beware full / partial paths). Example given this archive:

   zpaqfranz a z:\1.zpaq c:\nz\

If you

   zpaqfranz x z:\1.zpaq 

the files will be written into c:\nz\ (because of full-path)

If want to extract to, ex, y:\restored\c\nz\

   zpaqfranz x z:\1.zpaq -to y:\restored\

To restore into k:\extracted\copy2\nz\

   zpaqfranz x z:\1.zpaq  c:\nz\ -to k:\extracted\copy2\nz\

Please note the matching \ at the end
Yes, this is a rather strange behavior of zpaqfranz, but once accustomed is very powerful

The -only and -not options apply prior to renaming.

-until date | [-]version

Ignore any part of the archive updated after date or after version updates or -versions from the end if negative. A date is specified as a 4 digit year (1900 to 2999), 2 digit month (01 to 12), 2 digit day (01 to 31), optional 2 digit hour (00 to 23, default 23), optional 2 digit minute (00 to 59, default 59), and optional 2 digit seconds (00 to 59, default 59). Dates and times are always universal time zone (UT), not local time. Numbers up to 9999999 are interpreted as version numbers rather than dates. Dates may contain spaces and punctuation characters for readability but are ignored.
Another fundamental switch

-not [file]...

Do not extractfiles that match any file by name. file may contain wildcards * and ? that match any string or character respectively, including /. A match to a directory also matches all of its contents. In Windows, matches are not case sensitive, and \ matches /. In Unix/Linux, arguments with wildcards must be quoted to protect them from the shell.

-only file...

Do not extract any files unless they match at least one argument. The rules for matching wildcards are the same as -not. The default is * which matches everything. If a file matches an argument to both -only and -not, then -not takes precedence.

-repack new_archive [new_password]

With extract, store the extracted files in new_archive instead of writing them individually to disk. So you can, for example, quickly extract all *.xls files into a new .zpaq, without extracting and repacking. If new_password is specified, then the output is encrypted with this password. Otherwise the output is not encrypted, even if the input is. It is an error if new_archive exists unless -force is used to allow it to be overwritten.

Repacking is implemented by copying those D blocks (compressed file contents) which are referenced by at least one selected file. This can result in a larger archive than a new one because unreferenced fragments in the same block are also copied.

The repacked archive block dates range from the first to last update of the input archive. Using add -until with a date between these two dates will result in the date being adjust to 1 second after the last update.

With -all, the input archive is simply copied without modification except to decrypt and encrypt. Thus, the input may be any file, not just an archive. files and the options -to, -not, -only, -until, -noattributes, and -method are not valid with -repack -all.

-sN -summary N -summary

Brief output (deprecated in zpaqfranz)

-test

With extract, do not write to disk, but perform all other operations normally. extract will decompress, compute the SHA-1 hashes of the output, report if it differs from the stored value, but not compare, create or update any files. With -index, test for errors but do not create an index file.

-tN -threads N

Please note the SPACE -tN and -threads N Extract at most N blocks in parallel. The default is 0, which uses the number of processor cores, except not more than 2 when when zpaqfranz is compiled to 32-bit code. Selecting fewer threads will reduce memory usage but run slower. Selecting more threads than cores does not help.

-checksum

Force a full hash-code verify (if added with -checksum)

-kill

Extract to dummy, 0-length files. Da a empty-full restore.
Typically to check UTF/path length

-utf

Change everything non latin to latin (Linux/*Nix => NTFS compatibility)

-fix255

Shrink max file name, avoid different case collision (Linux => NTFS)
pippo.txt and PIPPO.txt are silently overwritten by 7.15.

-fixeml

Compress (heuristically) .eml filenames. For example "Fwd Fwd Fwd Fwd pippo.eml" become "Fwd pippo.eml"

-flat

Emergency restore of everything into a single folder (Linux => NTFS), losing path infos. Use when everything else fail (ex. extract Chinese-Linux created archive on FAT16 floppy disk)

-filelist

Show (if any) a stored VFILE (virtual file) filelist.
Version 52+ allows, using the -filelist switch, to automatically add a text file that contains the list of files added in that certain version. During the extraction the file will be shown if present, as if it were an l (list). The reason is to have on the one hand the log of what has been done, and on the other hand a greater display speed with very large archives (hundreds of GB) with many versions (thousands)

Clone this wiki locally