Skip to content

Repository files navigation

strarc — Stream Archiver

A Windows command-line backup and restore tool that streams files and their metadata through the Windows backup APIs. It uses its own archive format, with file headers followed by backup streams; it does not create tar or ZIP files.

The source identifies the current version as 0.4.0. The strarc manual includes a current compatibility note followed by the historical 0.3.0g manual from March 2015 and remains useful for options, backup strategies and historical limitations. Use strarc -? for the current command-line reference.

Capabilities

  • Archive and restore file data, alternate data streams, security information, timestamps and attributes, subject to filesystem support and available privileges.
  • Track hard links, preserve reparse points with -j, and handle sparse files and short 8.3 names.
  • Stream archives through standard input/output or external compression programs.
  • Select files with explicit lists or path filters, and use archive-attribute-based full, differential or incremental backups.
  • Save snapshots of loaded registry hives with -r.
  • Use the C++ StrArc class from strarc.hpp; the NMAKE build produces both strarc.exe and strarc.lib.

The executable attempts to enable the caller's backup and restore privileges. It does not grant missing privileges; file access and metadata restoration can still fail. Use an appropriately privileged account when backing up or restoring protected files and security information.

Quick start

These examples use Windows Command Prompt (cmd.exe). Create D:\Backups first and keep archive files outside the source tree.

Create an archive of C:\Data, storing junctions and other reparse points themselves:

strarc -c -j "-d:C:\Data" D:\Backups\data.sa

List the archive and then extract into a new destination directory:

strarc -t D:\Backups\data.sa
strarc -x -l "-d:D:\RestoredData" D:\Backups\data.sa

Preview which files would be backed up, without creating an archive:

strarc -c -n -l "-d:C:\Data"

Copy a tree through a pipe into a separate destination:

strarc -c -j "-d:C:\Data" | strarc -x -l "-d:D:\DataCopy"

Put switches before the archive name. Without an archive filename, creation writes to stdout and extraction/listing reads stdin. To supply backup file lists while using stdout, use - as the archive-name placeholder. Relative archive names are resolved before the working directory specified by -d is opened.

Creating a named archive overwrites it unless -a is used. Extraction skips existing files by default; -o enables replacement, with conditional variants documented in the manual. Restore to a fresh directory first and review diagnostics before replacing existing data.

Common options

Option Purpose
-c, -x, -t Create, extract, or read/list an archive without extracting its files. Select one mode.
-d:DIR Select the source or destination directory. Extraction can create the destination.
-j Back up reparse points instead of following their targets.
-l List filenames during backup or restore. Cannot accompany archive output to stdout, -t or -v.
-v Send detailed diagnostics to stderr.
-e:LIST, -i:LIST Exclude/include comma-separated relative-path substrings; exclusions take precedence.
-f, -F Read backup filenames from stdin as ANSI or Unicode text, respectively.
-s:s Skip security information during backup or restore. See the manual for other metadata-skip flags.
-m:f, -m:d, -m:i Full, differential or incremental selection using archive attributes. Full and incremental modes clear those attributes on successfully backed-up files.
-z:CMD Run an external filter for archive I/O, such as a compression/decompression utility.
-b:SIZE Set the stream buffer size. The current source default is 128 KiB, overridable at compile time.

Without -m, the default copy-backup method includes files without clearing their archive attributes. Archive compression is supplied by an external program, not built into the format.

Backup and restore limits

The manual's Windows NT/2000/XP/2003 wording and version-specific bug notes are historical, not a current compatibility matrix. In particular, its 512 KiB buffer default differs from the current source.

EFS encryption state is not preserved: the archive is not encrypted by strarc, and extraction does not re-encrypt the files. Compression state of individual alternate data streams is also not preserved. Short-name and security restoration depend on the target filesystem and privileges.

The -r feature snapshots registry hives; it does not provide a VSS snapshot or application-consistent capture of an entire live system. Its temporary .$sards files can remain if the run is interrupted or their directories are excluded. See the manual's registry-backup section before using it.

If reading a source file's backup streams fails, creation logs the error to stderr, pads any already-advertised stream payload with zeros, writes a failed-entry record, and continues with later files. Incomplete stream headers and names are withheld entirely. This works with archive files, stdout, pipes and compression filters; no seeking or whole-file staging is required. The final summary reports successful and failed entry counts and returns nonzero. Files that cannot be opened at all retain the existing skip-and-report behavior.

Use strarc 0.4.0 or later to extract or test archives containing failed-entry records. Older extractors do not understand the record and may leave padded files behind. New extractors still read older archives. Successful entries keep the existing format. See archive format and failure handling.

Extraction discards a marked regular file that it opened, reports the source error, and continues; test mode and excluded/skipped entries also report the record and return nonzero, without deleting an existing destination. Failed directory metadata does not delete the directory or its recovered children. If removal of a failed extraction is denied, strarc reports that too; the partial file may remain. Extraction with overwrite enabled is not transactional: an existing destination already overwritten cannot be recovered by discarding the failed entry.

Padding can be large if an error occurs near the beginning of a large stream. Cancellation or archive-output failure still stops creation; an unfinished padding/record sequence can leave an incomplete entry. This change recovers later files, not the unreadable contents of the failed file.

Restore scans damaged regions in buffered sequential blocks, including when reading from a pipe. This speeds up resynchronization but cannot recover later headers already consumed as payload of an earlier incomplete stream. See reliability tests for the fault-injection harness and native Windows smoke test.

-t reads the archive and reports structural/read errors, but the format has no cryptographic integrity check. Review stderr and perform a trial restore for important backups; per-file errors can be reported while the command continues, so a zero exit code alone does not prove a complete backup or restore.

Building

The repository has a Visual Studio solution and a separate NMAKE build. The checked-in Visual C++ project selects:

Platform Debug toolset Release toolset
Win32 v120 v90
x64 v120 v90
ARM v140 v140

Build outputs (strarc.lib, strarc.exe and compiled resources) must be rebuilt from the current sources; obsolete checked-in libraries and resources have been removed.

Both build routes require shared LTR Data headers and libraries outside this repository. Headers such as winstrct.h, ntfileio.hpp and spsleep.h are in LTRData/include. The project imports ..\winstrct.props and, for some configurations, absolute paths to the maintainer's WDK 7 and signing property sheets. The local strarc.props also contains a fixed WDK library path. Arrange or adapt these dependencies before building.

The root Makefile uses cl, link, lib and rc, writes outputs under the CPU directory, and includes ARM/ARM64 branches as well as x86/x64 handling. It uses _BUILDARCH when set, otherwise CPU or an i386 default, and explicitly requires ..\lib\minwcrt.lib. Its install targets contain maintainer-specific drive paths. These are legacy build configurations, not a self-contained modern SDK build.

License and history

MIT License, by Olof Lagerkvist. The standalone license preserves the historical notice in strarc.txt.

Some code originated in Olof Lagerkvist's commercial ntarc tool from 1998–2000 and was subsequently released as part of strarc, as described in the original manual.

About

Stream Archiver - A "tar" like archiver for Windows that uses backup API to read and write files along with all meta data.

Resources

Stars

5 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages