Skip to content

Configuration

Vykar is driven by a YAML configuration file. Generate a starter config with:

Terminal window
vykar config
Key Purpose Section
repositories Where backups are stored Repositories
sources What to back up Sources
encryption Mode and passphrase source Encryption
compression Algorithm and level Compression
chunker Chunk size parameters Chunker
exclude_patterns, exclude_if_present, one_file_system, git_ignore, xattrs What to leave out Exclude Patterns
retention Which snapshots prune keeps Retention
compact, check Maintenance steps of the full cycle Compact, Check
limits Threads, connections, bandwidth, niceness Limits
hooks Shell commands around each step Hooks
schedule Daemon and GUI scheduling Schedule
hostname Hostname recorded in snapshots Hostname
env_file .env files for ${VAR} expansion Environment Variable Expansion
cache_dir Local cache location Config file locations

Vykar automatically finds config files in this order:

  1. --config <path> flag
  2. VYKAR_CONFIG environment variable
  3. ./vykar.yaml (project)
  4. User config dir + vykar/config.yaml:
    • Unix: $XDG_CONFIG_HOME/vykar/config.yaml or ~/.config/vykar/config.yaml
    • Windows: %APPDATA%\vykar\config.yaml
  5. System config:
    • Unix: /etc/vykar/config.yaml
    • Windows: %PROGRAMDATA%\vykar\config.yaml

You can also set VYKAR_PASSPHRASE to supply the passphrase non-interactively.

Override the local cache directory with cache_dir at the top level:

cache_dir: "/tmp/vykar-cache"

Defaults to the platform cache directory when omitted.

A complete but minimal working config. Encryption defaults to auto (init benchmarks AES-256-GCM vs ChaCha20-Poly1305 and pins the repo), so you only need repositories and sources:

repositories:
- url: "/backup/repo"
sources:
- "/home/user/documents"

Windows:

repositories:
- url: 'D:\Backups\repo'
sources:
- 'C:\Users\me\Documents'

Windows paths and YAML quoting: In YAML, double-quoted strings interpret backslashes as escape sequences — "C:\Users\..." will fail because \U is parsed as a hex escape. Use single quotes or no quotes for Windows paths:

# These work:
- 'C:\Users\me\Documents'
- C:\Users\me\Documents
# This does NOT work:
- "C:\Users\me\Documents"

Local:

repositories:
- label: "local"
url: "/backups/repo"
# Windows: url: 'D:\Backups\repo'

S3:

repositories:
- label: "s3"
url: "s3://s3.us-east-1.amazonaws.com/my-bucket/vykar"
region: "us-east-1"
access_key_id: "AKIA..."
secret_access_key: "..."

Each entry in the repositories list accepts the following fields. url is the only required one.

Common fields (all backends):

Field Default Values Description
url (required) string Repository URL or local path
label — string Human label for --repo targeting. Must be unique
allow_insecure_http false bool Allow plaintext HTTP (required for http:// and s3+http:// URLs)
min_pack_size 32 MiB (33554432) integer (bytes) Minimum pack file size
max_pack_size 192 MiB (201326592) integer (bytes) Maximum pack file size (hard ceiling: 512 MiB)

Every repository is addressed by its label, or by its URL when it has none — --repo, the GUI selector, and the daemon’s per-repo schedule rows all use that name. Two entries that resolve to the same name are rejected at load time. Two labeled entries may share a URL; their labels tell them apart.

S3 fields:

Field Default Values Description
region — string S3 region (defaults to us-east-1 at runtime)
access_key_id — string S3 access key ID (required for S3)
secret_access_key — string S3 secret access key (required for S3)
s3_soft_delete false bool Use soft delete for S3 Object Lock compatibility
s3_conditional_writes auto auto | on | off Put-if-absent (If-None-Match: *), used to create index heads. auto offers it on hosts of a tested or documented service only (AWS S3, Cloudflare R2, Scaleway, OVHcloud); on asserts that your S3-compatible service honours it atomically, also for concurrent requests (vykar’s own check only catches a service that ignores it), and is overridden on a known-bad service (IDrive e2), where put-if-absent is refused; off never. See Conditional writes

SFTP fields:

Field Default Values Description
sftp_key — string Path to SSH private key, or to a public key held by the SSH agent. When omitted, tries the SSH agent, then ~/.ssh/{id_ed25519, id_rsa, id_ecdsa}
sftp_agent — string Path to SSH agent socket, or named pipe on Windows. Defaults to SSH_AUTH_SOCK; on Windows, falls back to the OpenSSH agent pipe, then Pageant
sftp_known_hosts — string Path to known_hosts file. Defaults to ~/.ssh/known_hosts at runtime
sftp_timeout — integer (seconds, 5–300) Per-request timeout; upload data writes get four times this. Defaults to 30s; clamped to 5–300s range

REST server fields:

Field Default Values Description
access_token — string Bearer token for REST server auth

Per-repo override sections (optional, replace top-level when set): encryption, compression, retention, limits. Per-repo-only section: retry. Per-repo hooks are additive — both global and repo hooks are kept and executed in the order described in Execution order.

See Storage Backends for URL formats and examples per backend, and Transport security for plaintext HTTP and TLS certificates.

Add more entries to repositories: to back up to multiple destinations. Top-level settings serve as defaults; each entry can override encryption, compression, retention, and limits.

repositories:
- label: "local"
url: "/backups/local"
- label: "remote"
url: "s3://s3.us-east-1.amazonaws.com/bucket/remote"
region: "us-east-1"
access_key_id: "AKIA..."
secret_access_key: "..."
encryption:
passcommand: "pass show vykar-remote"
compression:
algorithm: "zstd" # Better ratio for remote
retention:
keep_daily: 30 # Keep more on remote
limits:
connections: 2
upload_mib_per_sec: 25

When limits is set on a repository entry, it replaces top-level limits for that repository.

Tip: Configuring both a local and a remote repository gives you a 3-2-1 backup setup: three copies of your data (the original files, the local backup, and the remote backup), on two different media types, with one copy offsite. The example above already achieves this.

By default, commands operate on all repositories. Use --repo / -R to target a single one:

Terminal window
vykar list --repo local
vykar list -R /backups/local

Retry settings for transient remote errors. Repo-level only — there is no top-level retry section. Uses exponential backoff with jitter.

repositories:
- url: "s3://..."
retry:
max_retries: 5
retry_delay_ms: 2000
Field Default Values Description
max_retries 5 integer Maximum retry attempts
retry_delay_ms 1500 integer (ms) Initial delay between retries
retry_max_delay_ms 60000 integer (ms) Maximum delay between retries

Note: The default (5 retries, ~1 minute of cumulative backoff on average with jitter, up to ~90s worst case) is sized to absorb a brief network gap such as WiFi reconnecting after laptop sleep. Raise max_retries further if you run on a flaky link; set it to 0 to fail fast for CI or scripted runs.

A retry wait ends at once on Ctrl-C (or Cancel in the GUI). The operation then stops as interrupted instead of retrying. A request already in flight is not cut short, except SFTP reads.

Sources define what to back up — filesystem paths, command output, or both. Each source entry produces one snapshot per backup run.

Simple form:

sources:
- "/home/user/documents"
- "/home/user/photos"
# Windows:
# - 'C:\Users\me\Documents'
# - 'C:\Users\me\Photos'

Simple entries are grouped into one source. With one simple path, the source label is derived from the directory name. With multiple simple paths, the grouped source label becomes default. Use rich entries if you want separate source labels or one snapshot per path.

Rich form (single path):

sources:
- label: "docs"
path: "/home/user/documents"
exclude: ["*.tmp", ".cache/**"]
# exclude_if_present: [".nobackup", "CACHEDIR.TAG"]
# one_file_system: true
# git_ignore: false
repos: ["main"] # Only back up to this repo (default: all)
retention:
keep_daily: 7
hooks:
before: "echo starting docs backup"

Each path: entry produces its own snapshot. To group multiple directories into a single snapshot, use paths: (plural) instead — see below.

Rich form (multiple paths):

Use paths (plural) to group several directories into a single source. An explicit label is required:

sources:
- label: "writing"
paths:
- "/home/user/documents"
- "/home/user/notes"
exclude: ["*.tmp"]

These directories are backed up together as one snapshot. You cannot use both path and paths on the same entry.

Inside a multi-path source, each path’s contents land in the snapshot under a prefix derived from its full absolute path: leading / stripped on Unix, drive-letter colon dropped and backslashes converted to forward slashes on Windows. For example, /etc lands at etc/…, /var/lib/machines/base/etc lands at var/lib/machines/base/etc/…, and C:\Users\me\docs lands at C/Users/me/docs/…. This lets paths with the same basename — paths: ["/etc", "/var/lib/machines/base/etc"] — coexist in one source without colliding.

Field Default Values Description
path — string Single directory to back up (mutually exclusive with paths)
paths — list of strings Multiple directories as one snapshot (requires label)
label derived string Source label. Auto-derived from dir name for single path; required for multi-path and dump-only
exclude [] list of strings Per-source exclude patterns (merged with global exclude_patterns)
exclude_if_present — list of strings Per-source marker files. Inherits global exclude_if_present when omitted; replaces global when set
one_file_system inherited bool Override global one_file_system
git_ignore inherited bool Override global git_ignore
xattrs inherited {enabled: bool} Override global xattrs
repos [] (all) list of strings Restrict to named repositories
retention inherited object Per-source retention policy
hooks {} object Source-level hooks (before/after/failed/finally only)
command_dumps [] list Command dump entries

Each source entry in rich form can override global settings. This lets you tailor backup behavior per directory:

sources:
- label: "docs"
path: "/home/user/documents"
exclude: ["*.tmp"]
xattrs:
enabled: false # Override top-level xattrs setting for this source
repos: ["local"] # Only back up to the "local" repo
retention:
keep_daily: 7
keep_weekly: 4
- label: "photos"
path: "/home/user/photos"
repos: ["local", "remote"] # Back up to both repos
retention:
keep_daily: 30
keep_monthly: 12
hooks:
after: "echo photos backed up"

Per-source fields that override globals: exclude, exclude_if_present, one_file_system, git_ignore, repos, retention, hooks, command_dumps.

Capture the stdout of shell commands directly into your backup. See Back Up → Command dumps for an introduction. Each source with command_dumps produces its own snapshot, and an explicit label is required.

Field Default Values Description
name (required) string Virtual filename (no / or \, no duplicates within source)
command (required) string Shell command whose stdout is captured (run via sh -c)

Output is stored as virtual files under vykar-dumps/ in the snapshot. On restore they appear as regular files (e.g. vykar-dumps/postgres.sql).

To include command dumps in the same snapshot as filesystem paths, add both to one source entry:

sources:
- label: server
paths:
- /etc
- /var/www
command_dumps:
- name: postgres.sql
command: pg_dump -U myuser mydb

If a dump command exits with non-zero status, the backup is aborted and adds nothing to the index. The packs it uploaded stay in the session journal: a following backup reuses the chunks it finds there again, and vykar compact reclaims the rest.

See Recipes for PostgreSQL, MySQL, MongoDB, and Docker examples.

Encryption is enabled by default (auto mode with Argon2id key derivation). You only need an encryption section to supply a passcommand or force a specific algorithm.

encryption:
mode: "chacha20poly1305"
passphrase: "correct-horse-battery-staple"
Field Default Values Description
mode "auto" "auto", "aes256gcm", "chacha20poly1305" Encryption algorithm. auto benchmarks at init
passphrase — string (quoted) Inline passphrase (not recommended for production)
passcommand — string (quoted) Shell command that prints the passphrase

Every repository is encrypted; there is no unencrypted mode. A config that says mode: "none" anywhere (at the top level or for one repository) fails to load as a whole, naming the repositories that say it, so no repository in that file can be used until the line is removed or changed. A repository created unencrypted by vykar 0.24 or earlier is not opened by this vykar: create a new repository and back up into it; vykar 0.24 can still restore from the old one.

passcommand runs through the platform shell:

  • Unix: sh -c
  • Windows: powershell -NoProfile -NonInteractive -Command

This applies to hooks and command_dumps as well. On Windows, when vykar itself has no console — the GUI, a scheduled task, a service — the script runs with no console window of its own, so nothing flashes on screen. Run from a terminal, the script inherits that terminal and prints to it as usual.

For vykar daemon, every repository must have a non-interactive passphrase source available (passcommand, passphrase, or VYKAR_PASSPHRASE).

LZ4 (default) is optimised for speed — even on incompressible data the overhead is negligible, and reduced I/O usually more than compensates. ZSTD gives better compression ratios at the cost of more CPU; level 3 is a good starting point. none disables compression entirely.

compression:
algorithm: "zstd"
zstd_level: 6
Field Default Values Description
algorithm "lz4" "lz4", "zstd", "none" Compression algorithm
zstd_level 3 integer, 1–22 Zstd compression level (only used with zstd). 1–3 favours speed, 6–9 balances speed and ratio, 19–22 maximises ratio at significant CPU cost. Most users should stay in the 3–6 range

Use --compression on the CLI to override the configured algorithm for a single backup run:

Terminal window
vykar backup --compression zstd
chunker:
min_size: 524288 # 512 KiB
avg_size: 2097152 # 2 MiB
max_size: 8388608 # 8 MiB
Field Default Values Description
min_size 512 KiB (524288) integer (bytes) Minimum chunk size. Must be ≤ avg_size
avg_size 2 MiB (2097152) integer (bytes) Average chunk size
max_size 8 MiB (8388608) integer (bytes, hard cap: 16 MiB) Maximum chunk size. Clamped to 16 MiB if set higher

All three sizes must be even. The defaults above have always met this requirement. Chunker parameters are stored when a repository is initialized; changing YAML does not change an existing repository’s parameters. Repositories created with odd parameters can still be listed and restored, but new backups are rejected. Use a new repository with even parameters for future backups. If your YAML still has odd chunker overrides, remove that block to use the defaults and access existing snapshots.

Vykar uses gitignore-style patterns for file exclusion. Patterns can be set globally (exclude_patterns) or per-source (exclude); both lists are merged at runtime.

Wildcards and exact names match at any depth within a source:

# Global excludes — apply to every source directory
exclude_patterns:
- "*.tmp" # any .tmp file, at any depth
- "*.log" # any .log file, at any depth
- ".cache/" # any directory named .cache (trailing / = dirs only)
- "__pycache__/" # same — directories only
- ".DS_Store" # exact filename, any depth
- "Thumbs.db"

Per-source excludes target specific paths within a single source:

sources:
- path: "/home/user/videos"
exclude:
- "/TV" # Excludes <source>/TV
- path: "/home/user/photos"
exclude:
- "/thumbnails" # Excludes <source>/thumbnails
- "/My Albums" # Spaces in paths work fine

Per-source exclude patterns are added after global exclude_patterns. Both lists use the same matching rules.

Where a pattern matches depends on whether it contains a /:

  • No slash (e.g., *.tmp, TV): matches at any depth, as if prefixed with **/.
  • Contains a slash (e.g., logs/debug, /Downloads): anchored to the source root. A leading / is optional — logs/debug and /logs/debug behave identically.
  • Trailing / (e.g., .cache/): only matches directories.

Important: Patterns are matched against paths relative to each source directory, not against absolute filesystem paths. An absolute path like /home/user/videos/TV will not work — use per-source exclude with relative paths instead:

# WRONG — silently excludes nothing
exclude_patterns:
- "/home/user/videos/TV"
# CORRECT — anchored to the source root
sources:
- path: "/home/user/videos"
exclude:
- "/TV"

The ! prefix overrides an earlier exclude, re-including the matched file or directory:

exclude_patterns:
- "*.log"
- "!important.log" # keep important.log despite the *.log rule

Limitation: a negation cannot re-include a file if its parent directory was already excluded. The excluded directory is never traversed, so patterns for files inside it are never evaluated. To work around this, re-include each parent directory explicitly:

exclude_patterns:
- "log*" # excludes logfiles/, logs/, logfile.log, etc.
- "!logfiles/" # re-include the directory so it is traversed
- "!logfiles/logs/" # same for the nested directory
- "!logfile.log" # now this re-includes matching files inside
exclude_if_present: # Skip dirs containing any marker file
- ".nobackup"
- "CACHEDIR.TAG"
one_file_system: false # Do not cross filesystem/mount boundaries (default false)
git_ignore: false # Respect .gitignore files (default false)
xattrs: # Extended attribute handling
enabled: true # Preserve xattrs on backup/restore (default true, Unix-only)
Field Default Values Description
exclude_if_present [] list of strings Marker filenames — directories containing any of these are skipped
one_file_system false bool Don’t cross filesystem/mount boundaries
git_ignore false bool Respect .gitignore files in source dirs
xattrs.enabled true bool Preserve extended file attributes on backup/restore (Unix only)

By default, vykar records the short system hostname (everything before the first .) in each snapshot. On macOS, gethostname() returns a network-dependent FQDN (e.g. MyMac.local vs MyMac.fritz.box depending on VPN); truncating at the first dot keeps the hostname stable across network changes. On Linux and Windows, hostnames typically have no dots, so this is a no-op.

To override the hostname recorded in snapshots:

hostname: MyMachine
Field Default Values Description
hostname — string Override hostname in snapshots. Defaults to system short hostname at runtime

This only affects snapshot metadata — session markers (and the legacy lock key of a v2/v3 upgrade) always use the raw system hostname.

All fields optional. At least one should be set for the policy to have effect.

retention:
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
keep_within: "2d"
Field Default Values Description
keep_last — integer Keep N most recent snapshots
keep_hourly — integer Keep N hourly snapshots
keep_daily — integer Keep N daily snapshots
keep_weekly — integer Keep N weekly snapshots
keep_monthly — integer Keep N monthly snapshots
keep_yearly — integer Keep N yearly snapshots
keep_within — duration string (h/d/w/m/y) Keep all snapshots within this period. Suffixes: h = hours, d = days, w = weeks, m = months (30d), y = years (365d)
compact:
threshold: 30
Field Default Values Description
threshold 20 number, 0–100 Minimum % unused space to trigger repack. Reset to default if out of range

Control the integrity check step of the full cycle — bare vykar, vykar daemon, and GUI backup runs. Standalone vykar check always runs a full 100% check regardless of these settings.

check:
max_percent: 10
full_every: "30d"
Field Default Values Description
max_percent 0 integer, 0–100 % of packs/snapshots to verify per scheduled cycle. 0 = skip partial checks
full_every (unset) duration string (s/m/h/d) Full 100% check interval. Overrides max_percent when due. Omit the field to disable periodic full checks

How it works: A full 100% check runs only when full_every is set and due — which includes the case where its timestamp file is missing, corrupt, or belongs to a different repository — and the timestamp is then updated. Otherwise, if max_percent > 0, a random sample of that percentage of packs and snapshots is verified. With neither set (the default), the check step is skipped without opening the repository.

Standalone vykar check always runs at 100% and does not update the daemon’s timer — manual checks don’t reset the schedule.

limits:
connections: 4
upload_mib_per_sec: 50
Field Default Values Description
connections 2 integer, 1–16 Parallel backend operations; also controls upload/restore concurrency
threads 0 integer, 0–128 CPU worker threads. 0 = auto: local repos use ceil(cores/2) clamped to [2, 4], or 1 on a single-core host; remote repos use min(cores, 4). 1 = one transform worker. The walk and the commit stage run on threads of their own; a backup still uses mostly one core; to lower its CPU priority use nice. Also available as --threads on the backup subcommand
nice 0 integer, -20–19 Unix process niceness. 0 = unchanged. Applied to every thread of the process and never lowered again (see below). Ignored on Windows
upload_mib_per_sec 0 integer (MiB/s) Upload bandwidth cap (average over the run; individual packs go out at link speed). 0 = unlimited
download_mib_per_sec 0 integer (MiB/s) Download bandwidth cap (average over the run; individual reads arrive at link speed). 0 = unlimited

limits.connections also controls SFTP connection pool size, backup in-flight uploads, and restore reader concurrency. Internal pipeline knobs are now derived automatically from connections and threads.

limits.nice is a one-way ratchet. Lowering the nice value again needs CAP_SYS_NICE or a raised RLIMIT_NICE on Linux and root on macOS, which an unprivileged process does not have, so the value is applied to every thread and never restored. For a single vykar backup run this is irrelevant. The daemon and the GUI run backups in-process and therefore keep the value for the rest of their lifetime; with several repositories, the highest configured nice wins. A thread already at or above the target is left alone, so a lower value in a later run does not fail. If the daemon or GUI should keep its own priority between runs, leave limits.nice at 0 and schedule backups as separate vykar backup processes (systemd timer or cron) under Nice= or nice -n, which gives per-backup priority.

On Linux builds linked against glibc, the CLI adjusts two process-wide allocator settings at startup to reduce retained memory:

Knob Value Environment variable GLIBC_TUNABLES entry
Arena limit 2 MALLOC_ARENA_MAX glibc.malloc.arena_max=N
mmap threshold 1 MiB MALLOC_MMAP_THRESHOLD_ glibc.malloc.mmap_threshold=N

Together these cut peak resident memory by roughly 40% for a few percent more CPU time; see Architecture → Allocator tuning for the measurements. To override a knob, set its variable in the environment before starting vykar (not in a config env_file) — for example MALLOC_ARENA_MAX=0 vykar backup restores glibc’s automatic arena limit. Note the trailing underscore in MALLOC_MMAP_THRESHOLD_. These settings do not apply to musl builds, which use mimalloc, or to other platforms.

Shell commands that run at specific points in the vykar command lifecycle. Hooks can be defined at three levels: global (top-level hooks:), per-repository, and per-source.

Global / per-repository hooks support both bare prefixes and command-specific variants:

hooks: # Global hooks: run for backup/prune/check/compact
before: "echo starting"
after: "echo done"
# before_backup: "echo backup starting" # Command-specific hooks
# failed: "notify-send 'vykar failed'"
# finally: "cleanup.sh"

Per-source hooks only support bare prefixes (before, after, failed, finally) — command-specific variants like before_backup are not valid at the source level. Source hooks always run for backup since that is the only command that processes sources.

sources:
- label: immich
path: /raid1/immich/db-backups
hooks:
before: '/raid1/immich/backup_db.sh' # Correct
# before_backup: '...' # NOT valid here — use 'before' instead
Hook Command-specific (global/repo only) Runs when Failure behavior
before before_<cmd> Before the command Aborts the command; exit 75 skips it quietly
after after_<cmd> After success only Logged, doesn’t affect result
failed failed_<cmd> After failure only Logged, doesn’t affect result
finally finally_<cmd> Always, regardless of outcome Logged, doesn’t affect result

Hooks only run for backup, prune, check, and compact. The bare form (before, after, etc.) fires for all four commands. The command-specific form (before_backup, failed_prune, etc.) fires only for that command and is only available at the global and per-repository levels — not in per-source hooks.

The CLI, the daemon and the GUI all run them, including for the GUI’s Prune action. vykar prune --compact runs the prune hooks around prune and then the compact hooks around compact, so after_prune fires before compact starts; if prune fails or is skipped, compact does not run. The bare before, after, failed and finally hooks run once for each of the two commands, first with VYKAR_COMMAND=prune and then with VYKAR_COMMAND=compact. A compact failure fires the compact failed hooks (bare failed and failed_compact), not failed_prune.

Dry runs (prune --dry-run, compact --dry-run, check --repair --dry-run) run no hooks; vykar prune --compact --dry-run runs neither the prune nor the compact hooks.

  1. before hooks run: global bare → repo bare → global specific → repo specific
  2. The vykar command runs (skipped if a before hook fails)
  3. On success: after hooks run (repo specific → global specific → repo bare → global bare) On failure: failed hooks run (same order)
  4. finally hooks always run last (same order)

If a before hook fails, the command is skipped and both failed and finally hooks still run. If it exits 75 instead, only finally hooks run — see Skipping a run.

Each hook key maps to a shell command (string) or list of commands.

A before hook that exits 75 asks vykar to skip the command without reporting an error. Use it for conditions that are expected, such as being away from your home network. Any other non-zero exit is still a failure.

hooks:
before_backup: nmcli -t -f active,ssid dev wifi | grep -q '^yes:HomeNetwork$' || exit 75

Exit 75 is only honoured in before hooks, at the global, repository or source level:

Situation Result
Remaining before hooks Not run
The command Not run
after / failed hooks Not run
finally hooks Run, with VYKAR_ERROR empty — an earlier before hook may have set up state they clean up
Exit 75 in after / failed / finally Ordinary hook warning; the skip is ignored
Hook killed by a signal or timed out Still an error

What each surface reports:

Surface Result
vykar backup / prune / compact / check Skipped: <reason> on stderr, exit code 0. With several repositories, an error or partial result in another one takes priority
vykar (default cycle) The summary shows skipped (<reason>), exit code 0
Cycle, backup skipped prune, compact and check are skipped too, so nothing connects to the repository
Cycle, a later step skipped (e.g. before_prune) Only that step is skipped
One source skipped Other sources continue, repository after hooks run, and the skip is reported
Every selected source skipped Treated as a repository-level skip: no repository after / failed hooks, finally hooks run
Daemon Logged at INFO (an unavailable repository at WARN). The cycle outcome is skipped only when every attempted repository skipped; otherwise it follows the repositories that ran. No early retry: the next attempt is the normal schedule
GUI Log line, no red status, no failure entry

Monitoring: a skip exits 0, so vykar backup && ping reports success even though no snapshot was created. Ping from an after_backup hook instead, which does not run on a skip.

Daemon status refresh: the status page is refreshed in the background and never delays the page or a backup cycle. A repository whose last cycle was skipped is not contacted until its next cycle runs. A repository that fails a status connect is marked error and not contacted again until its next cycle or a configuration reload (SIGHUP). Status calls do not retry. One case remains: without on_startup, each repository gets one status connect attempt at startup, because its hook has not run yet. A repository whose passphrase comes from a passcommand is the exception: the status page never runs a passcommand and uses the passphrase the last cycle accepted, so that repository shows pending until its first cycle (for a repository with a disabled schedule, its first SIGUSR1 cycle). If that cycle fails to resolve the passphrase, the row stays pending; the failure shows in the page’s last-cycle steps. Each row on the page shows its state (pending, ok, skipped, error) and when it was last refreshed.

Passphrases: the CLI, the daemon and the GUI resolve the passphrase after the before hooks, in the first step that needs one, and then keep it for the rest of the run (the daemon and the GUI keep it until the repository’s passphrase settings change). A skip hook therefore runs before any passcommand or prompt. A failure to resolve the passphrase is a failed step, so failed and finally hooks run; a repository that stays missing is skipped without one. A mistyped interactive entry is asked again, up to three prompts; a wrong configured passphrase is not. At startup and on reload the daemon only checks that each repository has a non-interactive source (passcommand, passphrase or VYKAR_PASSPHRASE). It does not run a passcommand then, so a passcommand that needs a before hook works, and a wrong or failing one is reported by the first cycle as a failed step.

In the default vykar cycle, in daemon cycles and in GUI backup cycles, a local repository whose config file is missing is skipped, in single-repository and multi-repository configs alike. That covers an unplugged drive, an unmounted share (an empty mount point) and a path that was never initialized.

  • The check runs after the backup step’s before hooks, so a before_backup hook may mount the repository first.
  • The skip behaves like a hook skip: finally hooks run, after and failed hooks do not, and prune, compact and check are skipped.
  • Because before hooks run first, a before hook that exits non-zero because the drive is absent (for example mountpoint -q /mnt/backup) makes the step fail: failed and finally hooks run, and the run reports an error. A guard hook that should skip instead must exit 75, e.g. mountpoint -q /mnt/backup || exit 75.
  • The CLI prints Warning: skipping '<repository>' — repository not found at '<path>' … and exits 0; the daemon logs it at WARN and records the repository as skipped; the GUI logs it, with no red status.
  • With -R, the cycle runs and fails as usual. vykar backup and the other subcommands, and the GUI’s per-repository and per-source backup, are not affected.

Monitoring: this skip exits 0, like a hook skip. Ping from an after_backup hook to notice that no snapshot was created.

Every hook receives details about the run as environment variables. All six are always set, and are empty when they have no value.

Variable Description
VYKAR_COMMAND The vykar command name (e.g. backup, prune)
VYKAR_REPOSITORY Repository URL
VYKAR_LABEL Repository label
VYKAR_ERROR Error message, empty if there was no error
VYKAR_SOURCE_LABEL Source label, in per-source hooks
VYKAR_SOURCE_PATH Source paths, in per-source hooks, joined with : on Unix and ; on Windows
hooks:
after_backup:
- 'echo "Backed up to $VYKAR_REPOSITORY"'
failed:
- 'notify-send "vykar $VYKAR_COMMAND failed: $VYKAR_ERROR"'

Always use the variables inside double quotes. Unquoted, sh splits the value into separate words and expands wildcards in it, and an error message is not text you control.

Write $VYKAR_ERROR, not ${VYKAR_ERROR}: the braced form is expanded by vykar when the config is loaded, before the hook exists. On Windows, hooks run in PowerShell, where the variables are $env:VYKAR_ERROR and so on.

Earlier versions also replaced {error}-style placeholders in the command text. They are no longer supported: vykar refuses to load a config whose hooks contain one, and the error names the variable to use instead.

See Recipes for practical hook examples: database dumps, filesystem snapshots, network-aware backups, and monitoring notifications.

Configure the built-in daemon scheduler for automatic periodic backups. Used with vykar daemon.

schedule:
enabled: true
every: "6h"
on_startup: true
Field Default Values Description
enabled false bool Enable scheduled backups
every — duration string (s/m/h/d) Interval between runs. Falls back to 24h when neither every nor cron is set. Mutually exclusive with cron
cron — 5-field cron expression Cron schedule. Mutually exclusive with every
on_startup false bool Run backup immediately when daemon starts
jitter_seconds 0 integer Random delay 0–N seconds added to each run
passphrase_prompt_timeout_seconds 300 integer (seconds) Deprecated — accepted but ignored. Interactive passphrase prompts are never timed out

The every field accepts m (minutes), h (hours), or d (days) suffixes; a plain integer is treated as days. If neither every nor cron is set, the default interval is 24h.

The cron field accepts a standard 5-field cron expression (minute hour dom month dow). Six-field (with seconds) and seven-field expressions are rejected.

schedule:
enabled: true
cron: "0 3 * * *" # daily at 3:00 AM
jitter_seconds: 60

Common cron examples:

  • "0 3 * * *" — daily at 3:00 AM
  • "30 2 * * 1-5" — weekdays at 2:30 AM
  • "0 */6 * * *" — every 6 hours on the hour
  • "0 0 * * 0" — weekly on Sunday at midnight

every and cron are mutually exclusive — setting both is a configuration error.

Jitter (jitter_seconds) applies in both modes. In cron mode, jitter is added after the computed cron tick. Keep jitter small relative to the cron cadence to avoid skipping slots.

Any repository entry may carry its own schedule: block. It replaces the top-level stanza wholesale — there is no field-level merge, so fields you leave out fall back to their defaults, not to the global values. This mirrors the per-repo limits, retention, encryption, and compression overrides.

schedule:
enabled: true
every: "1d" # default for every repository
repositories:
- url: sftp://backup@remote/srv/vykar
label: remote # inherits the daily schedule
- url: /mnt/nas/vykar
label: nas
schedule:
enabled: true # required — see below
every: "1h"
on_startup: true
jitter_seconds: 120 # not inherited from the global stanza

Every field is per-repo, including on_startup (only the repos that set it run at daemon/GUI startup) and jitter_seconds.

Because enabled defaults to false, an override that sets a cadence without enabled: true would silently switch that repository off. vykar rejects it:

repository 'nas': schedule sets a cadence but 'enabled' is false;
set `enabled: true` or remove the override

To opt one repository out of a global schedule, give it schedule: {enabled: false} with no cadence fields. The repository stays configured — it is skipped by the timer but still included in ad-hoc runs (SIGUSR1) and the status page.

The daemon starts as long as at least one repository has an enabled schedule.

Config files support environment variable placeholders in values:

repositories:
- url: "${VYKAR_REPO_URL:-/backup/repo}"
# access_token: "${VYKAR_ACCESS_TOKEN}"

Supported syntax:

  • ${VAR}: requires VAR to be set (hard error if missing)
  • ${VAR:-default}: uses default when VAR is unset or empty

Notes:

  • Placeholders are expanded after the file is parsed, inside values only. An expanded value is never read as YAML: it may contain #, : , quotes or line breaks, and it cannot add a list, a mapping or another setting.
  • Placeholders in comments are ignored. Placeholders in mapping keys are not expanded.
  • In a text setting the result is the text. In a number or boolean setting (sftp_timeout, min_pack_size, allow_insecure_http, one_file_system, keep_daily, zstd_level, limits.threads, …) the result is read as that type, quoted or not: a decimal number with an optional sign (no 0x, 0o, 0b or _), or true/false.
  • The variable’s text is used exactly as it is: surrounding spaces and quote characters are kept, where an unquoted placeholder used to drop them. A passphrase variable that carries quotes (some --env-file formats keep them) or a trailing space now includes them.
  • A variable cannot supply a list or a mapping. exclude_patterns: ${PATTERNS} fails to load. Write the list in the file and use one placeholder per item, as in exclude_patterns: ["${PATTERN_A}", "${PATTERN_B}"]. Inside [...] or {...} a placeholder must be quoted.
  • A variable that is set but empty gives an empty text. A number or boolean setting refuses it, and so do a repository url and a source path. To keep a setting’s default, leave the setting out; ${VAR:-} does not unset it.
  • Variable names must match [A-Za-z_][A-Za-z0-9_]*. A malformed or unset placeholder in a value fails config loading. The error names the setting (for example repositories[0].url) and the variable, not the value. No escape syntax is supported for a literal ${...} in a value.

Use env_file to load variables from one or more files before expansion. This is useful for Docker-style .env files that store credentials:

env_file: .db.env
# or multiple files:
# env_file:
# - .db.env
# - .app.env
repositories:
- url: /backup/repo
sources:
- label: databases
command_dumps:
- name: db.sql
command: "mysqldump -u '${DB_USER}' -p'${DB_PASSWORD}' '${DB_DATABASE}'"

Where .db.env contains:

DB_USER=myuser
DB_PASSWORD=s3cret
DB_DATABASE=myapp

Paths are resolved relative to the config file’s directory. The supported .env format is:

  • KEY=VALUE — plain assignment
  • export KEY=VALUE — export prefix is stripped
  • KEY="VALUE" or KEY='VALUE' — quotes are stripped
  • Blank lines and lines starting with # are skipped

Commands in command_dumps and hooks run via sh -c, so the shell performs its own variable expansion. There are two ways to reference variables:

Syntax Expanded by On missing var
${VAR} vykar (at config load) Hard error
$VAR shell (at runtime) Empty string (silent)

When using env_file, prefer ${VAR} — vykar loads the file first, then expands the placeholder, giving you an immediate error if the variable is missing.

If you cannot use env_file, you can source the .env file directly in the command:

command_dumps:
- name: db.sql
command: ". /path/to/.db.env && mysqldump -u $DB_USER -p$DB_PASSWORD $DB_DATABASE"

This pattern is self-contained and works without any wrapper script, but missing variables will silently produce empty strings.