BTRFS-BACKUP-NG-CONFIG(1)
π btrfs-backup-ng-config(1) β the config-management era π
okay bestie, pull up a chair, because this is the btrfs-backup-ng config family of commands β the ones that handle all your configuration files. Think of it as the group chat where your backups make Plans. β¨
It lives in the btrfs-backup-ng User Commands corner of the manual, and it's gonna help you create, validate, detect subvolumes, migrate from btrbk, and manage systemd integration. Iconic behavior, no notes.
β¨ NAME β¨
btrfs-backup-ng-config β configuration management commands. that's it, that's the vibe π
π SYNOPSIS π
btrfs-backup-ng config validate
btrfs-backup-ng config init [-i|--interactive] [-o FILE]
btrfs-backup-ng config import [-o FILE] BTRBK_CONF
btrfs-backup-ng config detect [--json] [-w|--wizard]
btrfs-backup-ng config migrate-systemd [--dry-run]
πΈ DESCRIPTION πΈ
Manage btrfs-backup-ng configuration files. These commands help you create, validate, detect subvolumes, migrate from btrbk, and manage systemd integration. literally your config's whole life cycle, and it's serving π«Ά
π SUBCOMMANDS π
π validate
Validate the current configuration file. Checks for syntax errors, missing required fields, and invalid values.
btrfs-backup-ng config validate
It also checks, on this machine and without root, that each enabled volume's source can actually be backed up: it can be read from this account, it exists, and it's a directory on btrfs. A native source must also be a subvolume root, since btrfs subvolume snapshot refuses anything else β a directory that's just chilling inside a subvolume gets reported with the subvolume that holds it. A snapper source (that's source = "snapper") is not required to be one, because snapper takes its snapshots itself. Remote targets are not probed; doctor does that. iykyk π
Exit status, because this is the part you actually need:
0β The file is valid and its volumes are usable here. slay β1β No config file was found, or the file itself is invalid and must be edited. π go fix it2β The file is valid, but this machine cannot back up these volumes: a source is missing, cannot be read from this account, is not a directory, is not on btrfs, or (for native sources) is not a subvolume root. π
π§ init
Generate an example configuration file with comments explaining all the options. Can be run in interactive mode for a guided setup wizard. it's giving β¨starter packβ¨
btrfs-backup-ng config init [-i|--interactive] [-o FILE]
-i,--interactiveβ Run the interactive configuration wizard. This guides you through setting up:- Global settings (snapshot directory, timestamp format)
- Parallelism settings
- Retention policies (hourly, daily, weekly, monthly, yearly)
- Email and webhook notifications
- Volumes to backup and their targets
Requires a terminal (TTY). Press Ctrl+C to cancel at any time. no judgment π«Ά
Saved over an existing configuration, the wizard keeps every option it does not ask about: volumes are matched by path and targets by path within their volume, and options such as a target's ssh_key, ssh_host_key_policy or optional are carried into the new file. Answers to the wizard's own questions win, including an option answered by leaving it out. Before asking whether to overwrite, it lists what it kept and what it will remove (a volume or target the new configuration no longer has). Comments in the old file are not kept. π
-o,--outputFILE β Write output to FILE instead of stdout.
Example, bestie:
# Generate example config to stdout
btrfs-backup-ng config init > ~/.config/btrfs-backup-ng/config.toml
# Generate example config to file
btrfs-backup-ng config init -o /etc/btrfs-backup-ng/config.toml
# Run interactive wizard
btrfs-backup-ng config init --interactive
# Run interactive wizard and save to file
btrfs-backup-ng config init -i -o config.toml
π¦ import
Import a btrbk configuration file and convert it to TOML format. This helps you migrate from btrbk to btrfs-backup-ng. glow-up arc, fr fr β¨
btrfs-backup-ng config import [-o FILE] BTRBK_CONF
- BTRBK_CONF β Path to the
btrbk.conffile to import. -o,--outputFILE β Write output to FILE instead of stdout.
The importer is out here doing the most:
- Parses btrbk's custom syntax
- Resolves inheritance (options cascade down)
- Converts retention policies
- Maps timestamp formats (
short,long,long-isoto strftime patterns) - Converts SSH sudo settings (backend
btrfs-progs-sudotossh_sudo) - Converts
raw_target_compressandraw_target_encryptsettings - Warns about common btrbk pitfalls
- Outputs valid TOML
Timestamp format mapping, so you know exactly what you're getting:
shortβ%Y%m%d(e.g.,20260109)longβ%Y%m%dT%H%M(e.g.,20260109T1430)long-isoβ%Y%m%dT%H%M%S%z(e.g.,20260109T143052+0000)
Example:
btrfs-backup-ng config import /etc/btrbk/btrbk.conf
btrfs-backup-ng config import /etc/btrbk/btrbk.conf -o config.toml
--forceβ Overwrite the output file if it already exists. do it, no fear π₯
π₯ detect
Scan the system for btrfs subvolumes and suggest backup configurations. This command helps you discover what subvolumes exist on your system and categorizes them for backup purposes. detective mode: activated π΅οΈββοΈ
btrfs-backup-ng config detect [--json] [-w|--wizard]
--jsonβ Output results in JSON format for scripting and automation.-w,--wizardβ Launch the interactive configuration wizard with detected volumes pre-populated. Requires a terminal (TTY).
The detect command:
- Scans all mounted btrfs filesystems
- Lists all subvolumes found
- Categorizes subvolumes as recommended, optional, or excluded
- Suggests snapshot prefixes based on mount paths
- Identifies existing snapshots and system-internal subvolumes
Subvolume categories:
- Recommended β User data directories like
/homethat should be backed up. main character energy π - Optional β System data (
/opt,/var/log) that may or may not need backup. your call honestly - Excluded β Existing snapshots and system-internal subvolumes. not invited π«
Example:
# Scan for subvolumes (requires root for full access)
sudo btrfs-backup-ng config detect
# Output in JSON format
sudo btrfs-backup-ng config detect --json
# Launch wizard with detected volumes
sudo btrfs-backup-ng config detect --wizard
π migrate-systemd
Migrate systemd integration from btrbk to btrfs-backup-ng. This command stops and disables btrbk's systemd timer and enables btrfs-backup-ng's timer. out with the old, in with the slay π
btrfs-backup-ng config migrate-systemd [--dry-run]
--dry-runβ Show what would be done without making any changes. Use this to preview the migration before applying it. always preview first, bestie, we don't do impulsive π
The migrate-systemd command:
- Detects active btrbk systemd units (
btrbk.timer,btrbk.service) - Stops running btrbk timers
- Disables
btrbk.timer - Enables
btrfs-backup-ng.timer(if installed) - Prevents both tools from running simultaneously
Example:
# Preview migration (recommended first step)
btrfs-backup-ng config migrate-systemd --dry-run
# Apply migration
sudo btrfs-backup-ng config migrate-systemd
# If btrfs-backup-ng timer not installed, install it first
sudo btrfs-backup-ng install --timer=hourly
sudo btrfs-backup-ng config migrate-systemd
π CONFIGURATION FORMAT π
Configuration uses TOML format. Key sections, coming right up:
β¨ [global]
Global settings applied to all volumes unless overridden.
[global]
snapshot_dir = ".snapshots"
timestamp_format = "%Y%m%d-%H%M%S"
incremental = true
log_file = "/var/log/btrfs-backup-ng.log"
parallel_volumes = 2
parallel_targets = 2
β¨ [global.retention]
Default retention policy.
[global.retention]
min = "1d"
hourly = 24
daily = 7
weekly = 4
monthly = 12
yearly = 0
β¨ [[volumes]]
Volume definitions. Each volume specifies a source path and targets.
[[volumes]]
path = "/home"
snapshot_prefix = "home-"
snapshot_dir = ".snapshots" # optional override
[[volumes.targets]]
path = "/mnt/backup/home"
[[volumes.targets]]
path = "ssh://backup@server:/backups/home"
ssh_sudo = true
compress = "zstd"
rate_limit = "50M"
[volumes.retention] # optional override
daily = 14
π Raw targets
Raw targets write btrfs send streams to files instead of using btrfs receive. This enables backups to non-btrfs filesystems with optional compression and encryption. living outside the btrfs-box, love that for them β¨
# Raw target to local path with compression and GPG encryption
[[volumes.targets]]
path = "raw:///mnt/nas/backups/home"
compress = "zstd"
encrypt = "gpg"
gpg_recipient = "backup@example.com"
# Raw target over SSH
[[volumes.targets]]
path = "raw+ssh://backup@server/backups/home"
compress = "zstd"
# Raw target with OpenSSL encryption (btrbk compatible)
[[volumes.targets]]
path = "raw:///mnt/backup"
compress = "gzip"
encrypt = "openssl_enc"
openssl_cipher = "aes-256-cbc"
Configuration options for raw targets:
compressβ Compression method:gzip,pigz,zstd,lz4,xz,lzo,bzip2,pbzip2.encryptβ Encryption method:gpgoropenssl_enc.gpg_recipientβ GPG key recipient (required for gpg encryption).gpg_keyringβ Optional path to GPG keyring file.openssl_cipherβ OpenSSL cipher (default:aes-256-cbc).
For OpenSSL encryption, set the passphrase via environment variable BTRFS_BACKUP_PASSPHRASE or BTRBK_PASSPHRASE (for btrbk compatibility). keep that secret secret π€«
πΈ [notifications]
Optional notification settings. only if you want the drama π
[notifications]
on_success = false
on_failure = true
[notifications.email]
smtp_host = "smtp.example.com"
smtp_port = 587
from_addr = "backup@example.com"
to_addrs = ["admin@example.com"]
use_tls = true
username = "backup@example.com"
password = "secret"
[notifications.webhook]
url = "https://hooks.example.com/backup"
π FILES π
~/.config/btrfs-backup-ng/config.tomlβ User configuration file. your personal config, your personal era π/etc/btrfs-backup-ng/config.tomlβ System-wide configuration file. the communal one π
β SEE ALSO β
btrfs-backup-ng(1), toml(5)
go read them, bestie, they're worth it π«Ά
that's a wrap!! π
this page is from btrfs-backup-ng, dated January 2026 β and yes, that's the whole BTRFS-BACKUP-NG-CONFIG(1) moment. no cap, you understood all of it. periodt. β¨ππ¦
π¦ where this page comes from
- fedora 43: btrfs-backup-ng 0.9.20-2.fc43 Β· MIT
- fedora 44: btrfs-backup-ng 0.9.20-1.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms