Kopia Desk never re-copies files blindly. Before each backup run it scans the source folder, loads the manifest written by the previous run, and computes a three-way diff to find exactly which files are new, which have changed, and which have been deleted from the source. Only the first two categories are queued for copy. A quick hash — hashing the file size as a string prefix, then reading the first 64 KB and (for files larger than 64 KB) the last 64 KB — then confirms whether a file whose timestamp changed actually has different content, avoiding unnecessary copies of touch-only changes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Pachanga12/Kopia_Desk_Beta_1/llms.txt
Use this file to discover all available pages before exploring further.
Manifests
A manifest is a JSON object stored at.kopia-data/manifests/<sourceName>.json on the destination drive. Each key is the relative path of a file; the value is:
manifest:load IPC channel before the scan begins and saved with manifest:save after a successful copy. Before overwriting the current manifest, manifest:save copies it to <sourceName>.prev.json so one previous snapshot is always available.
hash in the manifest is null when deep verification mode is off. The field is only populated (and persisted) if the user enables the SHA-256 full-hash option.Directory Scan
scanDirectoryRecursive(dirPath, basePath, compiledExcludes) in lib/core.js walks the entire source tree and returns a flat object keyed by relative path:
fs.promises.readdirwith{ withFileTypes: true }avoids a secondstatcall just to distinguish files from directories;entry.isDirectory()andentry.isFile()are available directly on theDirentobject.Promise.allat each directory level processes all entries within a directory in parallel, maximising throughput especially on SSDs and USB drives with high seek latency amortised across concurrent requests.- EPERM / ENOENT swallowed silently because Windows frequently returns
EPERMfor protected system folders (System Volume Information, etc.). The scan continues rather than aborting.
Async I/O (
fs.promises) is used throughout instead of synchronous fs.readdirSync / fs.statSync. Blocking the main process would freeze the entire Electron window for the duration of the scan — unacceptable for folders with tens of thousands of files.Three-Way Diff
After the scan the renderer’sapp.js compares the scan result against the loaded manifest:
- New
- Changed
- Deleted
A relative path appears in the scan result but not in the manifest. The file did not exist during the previous backup run. It is queued for copy.
Quick Hash (quickHashFile)
When a file is detected as changed by size or lastModified, Kopia Desk can optionally run a quick hash to verify the content truly changed before copying. This avoids re-copying files whose timestamp was updated by an application without modifying the actual bytes.
String(size) + first 64 KB + last 64 KB (only if size > 64 KB). Using SHA-256 over size-prefixed head and tail catches the overwhelming majority of real content changes with at most two sequential reads of 64 KB, regardless of file size.
Full Hash (hashFileAsync)
When deep verification mode is enabled, or when computing a content fingerprint for deduplication, the entire file is streamed through crypto.createHash('sha256'):
hashFileAsync is called by copyOneTask in main.js when deduplication is active — the full SHA-256 of every file to be copied is computed before looking up or inserting an entry in the content index.
Content Index for Deduplication
When deduplication is enabled,main.js maintains a content index at .kopia-data/content-index.json:
main.js calls fs.promises.link to create a hardlink to the existing backup file instead of copying it again. The index is loaded at the start of a backup:copy-files call and saved atomically at the end of the session.
Manifest Versioning
Everymanifest:save call preserves exactly one prior version:
<sourceName>.json (current) and <sourceName>.prev.json (previous) are kept. There is no deeper version history in the manifest files themselves — older versions of changed files are stored as gzip-compressed copies inside .kopia-data/versions/.