borgmatic command-line reference

borgmatic options

Here are all of the available borgmatic command-line options. This includes the separate options for each action sub-command:

usage: borgmatic [-h] [-c [CONFIG_PATHS [CONFIG_PATHS ...]]]
                 [--excludes EXCLUDES_FILENAME] [-n] [-nc] [-v {0,1,2}]
                 [--syslog-verbosity {0,1,2}] [--version]
                 ...

A simple wrapper script for the Borg backup software that creates and prunes
backups. If none of the action options are given, then borgmatic defaults to:
prune, create, and check archives.

optional arguments:
  -h, --help            show this help message and exit

global arguments:
  -c [CONFIG_PATHS [CONFIG_PATHS ...]], --config [CONFIG_PATHS [CONFIG_PATHS ...]]
                        Configuration filenames or directories, defaults to:
                        /etc/borgmatic/config.yaml /etc/borgmatic.d
                        /root/.config/borgmatic/config.yaml
  --excludes EXCLUDES_FILENAME
                        Deprecated in favor of exclude_patterns within
                        configuration
  -n, --dry-run         Go through the motions, but do not actually write to
                        any repositories
  -nc, --no-color       Disable colored output
  -v {0,1,2}, --verbosity {0,1,2}
                        Display verbose progress to the console (from none to
                        lots: 0, 1, or 2)
  --syslog-verbosity {0,1,2}
                        Display verbose progress to syslog (from none to lots:
                        0, 1, or 2). Ignored when console is interactive
  --version             Display installed version number of borgmatic and exit

actions:
                        Specify zero or more actions. Defaults to prune,
                        create, and check. Use --help with action for details:
    init (--init, -I)   Initialize an empty Borg repository
    prune (--prune, -p)
                        Prune archives according to the retention policy
    create (--create, -C)
                        Create archives (actually perform backups)
    check (--check, -k)
                        Check archives for consistency
    extract (--extract, -x)
                        Extract a named archive to the current directory
    list (--list, -l)   List archives
    info (--info, -i)   Display summary information on archives

--------------------------------------------------------------------------------

usage: borgmatic init -e ENCRYPTION_MODE [--append-only]
                      [--storage-quota STORAGE_QUOTA] [-h]

Initialize an empty Borg repository

init arguments:
  -e ENCRYPTION_MODE, --encryption ENCRYPTION_MODE
                        Borg repository encryption mode
  --append-only         Create an append-only repository
  --storage-quota STORAGE_QUOTA
                        Create a repository with a fixed storage quota
  -h, --help            Show this help message and exit

--------------------------------------------------------------------------------

usage: borgmatic prune [--stats] [-h]

Prune archives according to the retention policy

prune arguments:
  --stats     Display statistics of archive
  -h, --help  Show this help message and exit

--------------------------------------------------------------------------------

usage: borgmatic create [--progress] [--stats] [--json] [-h]

Create archives (actually perform backups)

create arguments:
  --progress  Display progress for each file as it is processed
  --stats     Display statistics of archive
  --json      Output results as JSON
  -h, --help  Show this help message and exit

--------------------------------------------------------------------------------

usage: borgmatic check [-h]

Check archives for consistency

check arguments:
  -h, --help  Show this help message and exit

--------------------------------------------------------------------------------

usage: borgmatic extract [--repository REPOSITORY] --archive ARCHIVE
                         [--restore-path RESTORE_PATHS [RESTORE_PATHS ...]]
                         [--progress] [-h]

Extract a named archive to the current directory

extract arguments:
  --repository REPOSITORY
                        Path of repository to extract, defaults to the
                        configured repository if there is only one
  --archive ARCHIVE     Name of archive to operate on
  --restore-path RESTORE_PATHS [RESTORE_PATHS ...]
                        Paths to restore from archive, defaults to the entire
                        archive
  --progress            Display progress for each file as it is processed
  -h, --help            Show this help message and exit

--------------------------------------------------------------------------------

usage: borgmatic list [--repository REPOSITORY] [--archive ARCHIVE] [--short]
                      [--format FORMAT] [--json] [-P PREFIX] [-a GLOB]
                      [--sort-by KEYS] [--first N] [--last N] [-e PATTERN]
                      [--exclude-from FILENAME] [--pattern PATTERN]
                      [--pattern-from FILENAME] [-h]

List archives or the contents of an archive

list arguments:
  --repository REPOSITORY
                        Path of repository to list, defaults to the configured
                        repository if there is only one
  --archive ARCHIVE     Name of archive to list
  --short               Output only archive or path names
  --format FORMAT       Format for file listing
  --json                Output results as JSON
  -P PREFIX, --prefix PREFIX
                        Only list archive names starting with this prefix
  -a GLOB, --glob-archives GLOB
                        Only list archive names matching this glob
  --sort-by KEYS        Comma-separated list of sorting keys
  --first N             List first N archives after other filters are applied
  --last N              List first N archives after other filters are applied
  -e PATTERN, --exclude PATTERN
                        Exclude paths matching the pattern
  --exclude-from FILENAME
                        Exclude paths from exclude file, one per line
  --pattern PATTERN     Include or exclude paths matching a pattern
  --pattern-from FILENAME
                        Include or exclude paths matching patterns from
                        pattern file, one per line
  -h, --help            Show this help message and exit

--------------------------------------------------------------------------------

usage: borgmatic info [--repository REPOSITORY] [--archive ARCHIVE] [--json]
                      [-P PREFIX] [-a GLOB] [--sort-by KEYS] [--first N]
                      [--last N] [-h]

Display summary information on archives

info arguments:
  --repository REPOSITORY
                        Path of repository to show info for, defaults to the
                        configured repository if there is only one
  --archive ARCHIVE     Name of archive to show info for
  --json                Output results as JSON
  -P PREFIX, --prefix PREFIX
                        Only show info for archive names starting with this
                        prefix
  -a GLOB, --glob-archives GLOB
                        Only show info for archive names matching this glob
  --sort-by KEYS        Comma-separated list of sorting keys
  --first N             Show info for first N archives after other filters are
                        applied
  --last N              Show info for first N archives after other filters are
                        applied
  -h, --help            Show this help message and exit