Skip to content

Restore

Terminal window
# List all snapshots
vykar list
# List the 5 most recent snapshots
vykar list --last 5
# List snapshots for a specific source
vykar list --source docs

Snapshot-oriented commands take an exact snapshot ID, or latest.

Terminal window
# List files inside a snapshot
vykar snapshot list a1b2c3d4
# List with details (type, permissions, size, mtime)
vykar snapshot list a1b2c3d4 --long
# Limit listing to a subtree
vykar snapshot list a1b2c3d4 --path src
# Sort listing by size (name, size, mtime)
vykar snapshot list a1b2c3d4 --sort size
# Show snapshot metadata (time, source, sizes)
vykar snapshot info a1b2c3d4
# Compare changed files between two snapshots
vykar snapshot diff a1b2c3d4 latest

Use snapshot find to locate files before choosing which snapshot to restore from.

Terminal window
# Find PDFs modified in the last 14 days
vykar snapshot find --name '*.pdf' --since 14d
# Limit search to one source and recent snapshots
vykar snapshot find --source docs --last 10 --name '*.docx'
# Search under a subtree with case-insensitive name matching
vykar snapshot find sub --iname 'report*' --since 7d
# Combine type and size filters
vykar snapshot find --type f --larger 1M --smaller 20M --since 30d
  • --last must be >= 1.
  • --since accepts positive spans with suffix h, d, w, m (months), or y (for example: 24h, 7d, 2w, 6m, 1y).
  • --larger means at least this size, and --smaller means at most this size.
Terminal window
# Restore all files from a snapshot
vykar restore a1b2c3d4 /tmp/restored
# Restore the most recent snapshot
vykar restore latest /tmp/restored

Restore applies extended attributes (xattrs) by default. Control this with the top-level xattrs.enabled config setting.

On a terminal, vykar restore shows a progress line on stderr: the files and bytes written against those planned so far. Above 100,000 files the totals grow batch by batch and are shown with a +. Nothing is printed when stderr is not a terminal.

Restore, like every read command, registers no session and needs only read access to the repository, so it runs while backups, prune or compact run elsewhere: data a concurrent compact moves is read from its new place. A snapshot that is deleted and compacted while it is being restored fails with “chunk … was removed from the repository while it was being read”; nothing is published to the destination. Run the restore again (of a snapshot that still exists), and run vykar check if the snapshot is still listed.

--pattern takes a single glob, matched against paths as they are stored in the snapshot — exactly what vykar snapshot list prints. Check that form before writing a pattern.

Terminal window
# See the stored path form first
vykar snapshot list a1b2c3d4 | head
# Restore one subtree (the directory and everything under it)
vykar restore a1b2c3d4 /tmp/restored --pattern 'reports*'
# Multi-source snapshot: paths carry the source prefix
vykar restore a1b2c3d4 /tmp/restored --pattern 'home/user/documents/reports*'
# Every PDF, at any depth
vykar restore a1b2c3d4 /tmp/restored --pattern '*.pdf'
  • Stored paths never begin with /. Backing up the single source /home/user/documents stores reports/q1.pdf; with several sources each path is prefixed with the source’s absolute path minus the leading /, giving home/user/documents/reports/q1.pdf.
  • * spans /, so reports* already selects the whole subtree — no ** needed, and *.pdf matches at any depth. This differs from snapshot find --name, where * stops at a path separator.
  • The glob must match the whole path. --pattern 'reports' restores only the directory itself, empty; use reports* to include its contents.
  • Quote the pattern, or your shell expands * against the current directory before vykar sees it.
  • Files land under the destination at their full stored path: restoring home/user/documents/reports* into /tmp/restored gives /tmp/restored/home/user/documents/reports/.
  • A pattern whose leading path components contain no glob characters (home/user/documents/reports*) reads only that part of the snapshot’s listing; a pattern starting with a glob character (*.pdf, reports*) reads all of it.
  • A pattern that matches nothing is not an error — restore reports Restored: 0 files, 0 dirs, 0 symlinks. If you see that, re-check the paths with vykar snapshot list.

Important: patterns are matched against snapshot-relative paths, not absolute filesystem paths. --pattern '/home/user/documents/reports/*' silently matches nothing. Drop the leading / and use the form vykar snapshot list shows.

Browse snapshot contents via a local read-only WebDAV server. The same endpoint also serves a built-in HTML browser UI.

Terminal window
# Serve all snapshots (default: http://127.0.0.1:8080)
vykar mount
# Serve a single snapshot
vykar mount --snapshot a1b2c3d4
# Only snapshots from a specific source
vykar mount --source docs
# Custom listen address
vykar mount --address 127.0.0.1:9090

Snapshots and directories are loaded when first opened; with several snapshots, the server starts before any listing is read.

By default a restore is all-or-nothing: if any chunk cannot be read or decoded, the run aborts with no restored files were published and the destination stays empty.

To salvage everything that is still intact, add --continue-on-error:

Terminal window
vykar restore latest /tmp/restored --continue-on-error
  • A file counts as damaged when any of its chunks is missing from the index, its pack is missing or unreadable (including a truncated pack), or a chunk fails to decrypt, decompress or verify. A chunk shared by several files damages all of them, and every hard link to a damaged file is damaged too.
  • Damaged files are left out of the destination entirely, never written partially or as an empty placeholder. Everything that is restored has been fully read and verified.
  • Each damaged file is printed on stderr as damaged: <path>: <reason>, followed by a count. At most 10,000 are listed; the count is always exact.
  • The exit status is 3 when at least one file was skipped, and 0 when none was.
  • Destination-side failures (disk full, permission errors), a damaged snapshot item list, and conflicting entries in the snapshot still abort the run.
  • Remote storage errors count as damage too: an SFTP or S3 outage in the middle of a run produces a long damaged list and exit status 3 rather than an abort. Re-run the restore once the backend is reachable.

Afterwards, run vykar check --verify-data to find out what else in the repository is affected.

The desktop app always restores strictly; use the command line to restore around damage.

Next: Schedule Backups