Archive.createIncremental

Archive createIncremental(string fsRoot, string outDir, string base, string ext, CreateOpts co, IncrOpts io) @safe

Creates an incremental or differential backup archive.

This static factory creates a new archive containing only files that have changed since the reference archive was created. The reference archive is specified via IncrOpts.

Parameters

fsRootfilesystem root to back up
outDirdirectory where slices are written
basearchive base name for the new incremental archive
extslice extension (e.g., "dar")
cocreate options (use createOpts() builder)
ioincremental options specifying reference archive and policy

Returns

A new Archive instance wrapping the created incremental archive.

Throws

DarException if creation fails (I/O error, invalid reference,

permission denied, or other libdar-reported errors).

Example:

import ddn.wrp.dar;

// First create a full backup
auto co = createOpts().withAllowOverwrite(true).toLow();
auto fullBackup = Archive.create("/data", "/backups", "full", "dar", co);

// Later, create an incremental backup
auto io = incrOpts()
             .withReference("/backups", "full", "dar")
             .withMode(DarIncrMode.INCREMENTAL);
auto incrBackup = Archive.createIncremental("/data", "/backups", "incr1", "dar",
                                            createOpts().withAllowOverwrite(true), io);

Archive createIncremental(string fsRoot, string outDir, string base, string ext, CreateOptions co, IncrementalOptions io) @safe

Creates an incremental or differential backup using low-level options.

This overload accepts low-level CreateOptions and IncrementalOptions directly for cases where more control is needed.

Parameters

fsRootfilesystem root to back up
outDirdirectory where slices are written
basearchive base name for the new incremental archive
extslice extension (e.g., "dar")
colow-level create options
iolow-level incremental options

Returns

A new Archive instance wrapping the created incremental archive.

Throws

DarException if creation fails.