Reference

Note

The configuration file reference is generated from resticprofile’s data model and restic’s manual pages.

Sections

Section global

The global section is at the root of the configuration file and contains the global settings for resticprofile.

NameTypeDefaultNotes
ca-certificatesone or more stringsPath to PEM encoded certificates to trust in addition to system certificates when resticprofile sends to a webhook - see configuration/http_hooks/
default-commandstringsnapshotsThe restic or resticprofile command to use when no command was specified. Examples: backup, cache, cat, check, copy, diff, dump, find, forget, generate, init, key, list, ls, migrate, mount, prune, rebuild-index, recover, repair, repair-index, repair-snapshots, restore, rewrite, self-update, snapshots, stats, tag, unlock, version
group-continue-on-errortrue / falsefalseEnable groups to continue with the next profile(s) instead of stopping at the first failure
initializetrue / falsefalseInitialize a repository if missing
ionicetrue / falsefalseEnables setting the unix IO priority class and level for resticprofile and child processes (only on unix OS)
ionice-classinteger2Sets the unix “ionice-class” to apply when “ionice” is enabled. Must be >= 1 and <= 3
ionice-levelinteger0Sets the unix “ionice-level” to apply when “ionice” is enabled. Must be >= 0 and <= 7
legacy-argumentstrue / falsefalseLegacy, broken arguments mode of resticprofile before version 0.15
logstringSets the default log destination to be used if not specified in ‘–log’ or ‘schedule-log’ - see configuration/logs/
min-memoryinteger100Minimum available memory (in MB) required to run any commands - see usage/memory/
niceinteger0Sets the unix “nice” value for resticprofile and child processes (on any OS). Must be >= -20 and <= 19
prevent-sleeptrue / falsefalsePrevent the system from sleeping while running commands - see configuration/sleep/
prioritystringnormalSets process priority class for resticprofile and child processes (on any OS). Is one of idle, background, low, normal, high, highest
restic-arguments-filtertrue / falsetrueRemove unknown flags instead of passing all configured flags to restic
restic-binarystringFull path of the restic executable (detected if not set)
restic-lock-retry-afterinteger OR duration1mTime to wait before trying to get a lock on a restic repositoey - see usage/locks/
restic-stale-lock-ageinteger OR duration1hThe age an unused lock on a restic repository must have at least before resiticprofile attempts to unlock - see usage/locks/
schedulerstringLeave blank for the default scheduler or use “crond” to select cron on supported operating systems
send-timeoutinteger OR duration30sTimeout when sending messages to a webhook - see configuration/http_hooks/. Examples: 15s, 30s, 2m30s
shellone or more stringsautoThe shell that is used to run commands (default is OS specific). Examples: sh, bash, pwsh, powershell, cmd
systemd-timer-templatestringFile containing the go template to generate a systemd timer - see schedules/systemd/
systemd-unit-templatestringFile containing the go template to generate a systemd unit - see schedules/systemd/

Profile sections

In config file format v1, the name of this section is the name of your profile (excluding reserved names like global, groups, includes & version).

From config file format v2, profile sections are declared as named configuration structure below section profiles (see Configuration v2 for details).

Section profile

Flags used by resticprofile only:
NameTypeDefaultNotes
base-dirstringSets the working directory for this profile. The profile will fail when the working directory cannot be changed. Leave empty to use the current directory instead
descriptionstringDescribes the profile
envkey => valueAdditional environment variables to set in any child process
force-inactive-locktrue / falsefalseAllows to lock when the existing lock is considered stale
inheritstringName of the profile to inherit all of the settings from
initializetrue / falseInitialize the restic repository if missing
lockstringPath to the lock file to use with resticprofile locks
prometheus-labelskey => stringAdditional prometheus labels to set
prometheus-pushuriURL of the prometheus push gateway to send the summary of the last restic command result to
prometheus-push-formatstringtextPrometheus push gateway request format. Is one of text, protobuf
prometheus-push-jobstringPrometheus push gateway job name. $command placeholder is replaced with restic command
prometheus-save-to-filestringPath to the prometheus metrics file to update with a summary of the last restic command result
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
status-filestringPath to the status file to update with a summary of last restic command result
stream-errorone or more nested StreamErrorSectionRun shell command(s) when a pattern matches the stderr of restic
systemd-drop-in-filesone or more stringsFiles containing systemd drop-in (override) files - see schedules/systemd/
Flags passed to the restic command line:
NameTypeDefaultNotes
cacertstringfile to load root certificates from (default: use system certificates or $RESTIC_CACERT)
cache-dirstring""set the cache directory&. (default: use system default cache directory)
cleanup-cachetrue / falsefalseauto remove old cache directories
compressionstringautocompression mode (only available for repository format version 2), one of (auto/off/max) (default: $RESTIC_COMPRESSION). restic >= 0.14.0
extended-statustrue / falsefalseset output mode to JSON for commands that support it
insecure-tlstrue / falsefalseskip TLS certificate verification when connecting to the repository (insecure). restic >= 0.13.0
key-hintstring""key ID of key to try decrypting first (default: $RESTIC_KEY_HINT)
limit-downloadinteger0limits downloads to a maximum rate in KiB/s. (default: unlimited)
limit-uploadinteger0limits uploads to a maximum rate in KiB/s. (default: unlimited)
no-cachetrue / falsefalsedo not use a local cache
no-locktrue / falsefalsedo not lock the repository, this allows some operations on read-only repositories
optionone or more stringsset extended option (key=value)
pack-sizeinteger0set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE). restic >= 0.14.0
password-commandstring""shell command to obtain the repository password from (default: $RESTIC_PASSWORD_COMMAND)
password-filestring""file to read the repository password from (default: $RESTIC_PASSWORD_FILE)
quiettrue / falsefalsedo not output comprehensive progress report
repositorystring""repository to backup to or restore from (default: $RESTIC_REPOSITORY)
repository-filestring""file to read the repository location from (default: $RESTIC_REPOSITORY_FILE). restic >= 0.11.0
retry-lockstring0sretry to lock the repository if it is already locked, takes a value like 5m or 2h (default: no retries). restic >= 0.16.0
tls-client-certstring""path to a file containing PEM encoded TLS client certificate and private key (default: $RESTIC_TLS_CLIENT_CERT)
verbosetrue / false OR integer0be verbose (true for level 1 or a number for increased verbosity, max level is 2)
Note

Most restic command flags defined in profile sections below can also be set at profile level. They will be inherited in all sections that define these flags and ignored in all others.

go to top

Section profile.backup

This section configures restic command backup . Information on command and flags is copied from the restic manual pages.

The “backup” command creates a new snapshot and saves the files and directories given as the arguments.

Flags used by resticprofile only:
NameTypeDefaultNotes
check-aftertrue / falsefalseCheck the repository after the backup command succeeded
check-beforetrue / falsefalseCheck the repository before starting the backup command
no-error-on-warningtrue / falsefalseDo not fail the backup when some files could not be read
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
scheduleone or more stringsSet the times at which the scheduled command is run (times are specified in systemd timer format). Examples: hourly, daily, weekly, monthly, 10:00,14:00,18:00,22:00, Wed,Fri 17:48, *-*-15 02:45, Mon..Fri 00:30
schedule-after-network-onlinetrue / falsefalseDon’t schedule the start of this profile when the network is offline (supported in “systemd”)
schedule-capture-environmentone or more stringsRESTIC_*Set names (or glob expressions) of environment variables to capture during schedule creation. The captured environment is applied prior to “profile.env” when running the schedule. Whether capturing is supported depends on the type of scheduler being used (supported in “systemd” and “launchd”)
schedule-ignore-on-batterytrue / falsefalseDon’t schedule the start of this profile when running on battery
schedule-ignore-on-battery-less-thanintegerDon’t schedule the start of this profile when running on battery, and the battery charge left is less than the value
schedule-lock-modestringdefaultSpecify how locks are used when running on schedule - see schedules/configuration/. Is one of default, fail, ignore
schedule-lock-waitinteger OR durationSet the maximum time to wait for acquiring locks when running on schedule. Examples: 150s, 15m, 30m, 45m, 1h, 2h30m
schedule-logstringRedirect the output into a log file or to syslog when running on schedule. Examples: /resticprofile.log, tcp://localhost:514
schedule-permissionstringautoSpecify whether the schedule runs with system or user privileges - see schedules/configuration/. Is one of auto, system, user, user_logged_on
schedule-prioritystringbackgroundSet the priority at which the schedule is run. Is one of background, standard
send-afterone or more nested SendMonitoringSectionSend HTTP request(s) after a successful restic command
send-after-failone or more nested SendMonitoringSectionSend HTTP request(s) after failed restic or shell commands
send-beforeone or more nested SendMonitoringSectionSend HTTP request(s) before a restic command
send-finallyone or more nested SendMonitoringSectionSend HTTP request(s) always, after all other commands
sourceone or more stringsThe paths to backup. Examples: /opt/, /home/user/, C:\Users\User\Documents
source-basestringThe base path to resolve relative backup paths against. Defaults to current directory if unset or empty (see also “base-dir” in profile). Examples: /, $PWD, C:\, %cd%
stdin-commandone or more stringsShell command(s) that generate content to redirect into the stdin of restic. When set, the flag “stdin” is always set to “true”
Flags passed to the restic command line:
NameTypeDefaultNotes
dry-runtrue / falsefalsedo not upload or write any data, just show what would be done. restic >= 0.13.0
excludeone or more stringsexclude a pattern
exclude-cachestrue / falsefalseexcludes cache directories that are marked with a CACHEDIR.TAG file. See https://bford.info/cachedir/ for the Cache Directory Tagging Standard
exclude-fileone or more stringsread exclude patterns from a file
exclude-if-presentone or more stringstakes filename[:header], exclude contents of directories containing filename (except filename itself) if header of that file is as provided
exclude-larger-thanstring""max size of the files to be backed up (allowed suffixes: k/K, m/M, g/G, t/T). restic >= 0.10.0
extended-statustrue / falsefalseset output mode to JSON for commands that support it
files-fromone or more stringsread the files to backup from file (can be combined with file args)
files-from-rawone or more stringsread the files to backup from file (can be combined with file args). restic >= 0.12.0
files-from-verbatimone or more stringsread the files to backup from file (can be combined with file args). restic >= 0.12.0
forcetrue / falsefalseforce re-reading the target files/directories (overrides the “parent” flag)
group-bystringhost,pathsgroup snapshots by host, paths and/or tags, separated by comma (disable grouping with ‘’). restic >= 0.16.0
hosttrue / false OR hostname""set the hostname for the snapshot manually. To prevent an expensive rescan use the “parent” flag. Boolean true is replaced with the hostname of the system. Defaults to true for config version 2 in “backup”. Examples: true, false, "host"
iexcludeone or more stringssame as –exclude pattern but ignores the casing of filenames. restic >= 0.10.0
iexclude-fileone or more stringssame as –exclude-file but ignores casing of filenames in patterns. restic >= 0.10.0
ignore-ctimetrue / falsefalseignore ctime changes when checking for modified files. restic >= 0.12.0
ignore-inodetrue / falsefalseignore inode number changes when checking for modified files. restic >= 0.10.0
no-scantrue / falsefalsedo not run scanner to estimate size of backup. restic >= 0.15.0
one-file-systemtrue / falsefalseexclude other file systems, don’t cross filesystem boundaries and subvolumes
parentstring""use this parent snapshot (default: latest snapshot in the group determined by –group-by and not newer than the timestamp determined by –time)
read-concurrencyinteger0read n files concurrently (default: $RESTIC_READ_CONCURRENCY or 2). restic >= 0.15.0
stdintrue / falsefalseread backup from stdin
stdin-filenamestring"stdin"filename to use when reading from stdin
tagtrue / false OR one or more stringsadd tags for the new snapshot in the format tag[,tag,…]. Boolean true is unsupported in section “backup”. Examples: false, "tag"
timestring""time of the backup (ex. ‘2012-11-01 22:08:41’) (default: now)
use-fs-snapshottrue / falsefalseuse filesystem snapshot where possible (currently only Windows VSS). restic >= 0.12.0 . Available only for windows
with-atimetrue / falsefalsestore the atime for all files and directories

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.cache

This section configures restic command cache . Information on command and flags is copied from the restic manual pages.

The “cache” command allows listing and cleaning local cache directories.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
cleanuptrue / falsefalseremove old cache directories
max-ageinteger30max age in days for cache directories to be considered old
no-sizetrue / falsefalsedo not output the size of the cache directories

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.cat

This section configures restic command cat . Information on command and flags is copied from the restic manual pages.

The “cat” command is used to print internal objects to stdout.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.check

This section configures restic command check . Information on command and flags is copied from the restic manual pages.

The “check” command tests the repository for errors and reports any errors it finds. It can also be used to read all data and therefore simulate a restore.

By default, the “check” command will always load all data directly from the repository and not use a local cache.

Flags used by resticprofile only:
NameTypeDefaultNotes
scheduleone or more stringsSet the times at which the scheduled command is run (times are specified in systemd timer format). Examples: hourly, daily, weekly, monthly, 10:00,14:00,18:00,22:00, Wed,Fri 17:48, *-*-15 02:45, Mon..Fri 00:30
schedule-after-network-onlinetrue / falsefalseDon’t schedule the start of this profile when the network is offline (supported in “systemd”)
schedule-capture-environmentone or more stringsRESTIC_*Set names (or glob expressions) of environment variables to capture during schedule creation. The captured environment is applied prior to “profile.env” when running the schedule. Whether capturing is supported depends on the type of scheduler being used (supported in “systemd” and “launchd”)
schedule-ignore-on-batterytrue / falsefalseDon’t schedule the start of this profile when running on battery
schedule-ignore-on-battery-less-thanintegerDon’t schedule the start of this profile when running on battery, and the battery charge left is less than the value
schedule-lock-modestringdefaultSpecify how locks are used when running on schedule - see schedules/configuration/. Is one of default, fail, ignore
schedule-lock-waitinteger OR durationSet the maximum time to wait for acquiring locks when running on schedule. Examples: 150s, 15m, 30m, 45m, 1h, 2h30m
schedule-logstringRedirect the output into a log file or to syslog when running on schedule. Examples: /resticprofile.log, tcp://localhost:514
schedule-permissionstringautoSpecify whether the schedule runs with system or user privileges - see schedules/configuration/. Is one of auto, system, user, user_logged_on
schedule-prioritystringbackgroundSet the priority at which the schedule is run. Is one of background, standard
send-afterone or more nested SendMonitoringSectionSend HTTP request(s) after a successful restic command
send-after-failone or more nested SendMonitoringSectionSend HTTP request(s) after failed restic or shell commands
send-beforeone or more nested SendMonitoringSectionSend HTTP request(s) before a restic command
send-finallyone or more nested SendMonitoringSectionSend HTTP request(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
check-unusedtrue / falsefalsefind unused blobs. restic < 0.14.0
read-datatrue / falsefalseread all data blobs
read-data-subsetstring""read a subset of data packs, specified as ’n/t’ for specific part, or either ‘x%’ or ‘x.y%’ or a size in bytes with suffixes k/K, m/M, g/G, t/T for a random subset
with-cachetrue / falsefalseuse existing cache, only read uncached data from repository

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.copy

This section configures restic command copy available since 0.10.0 . Information on command and flags is copied from the restic manual pages.

The “copy” command copies one or more snapshots from one repository to another.

NOTE: This process will have to both download (read) and upload (write) the entire snapshot(s) due to the different encryption keys used in the source and destination repositories. This /may incur higher bandwidth usage and costs/ than expected during normal backup runs.

NOTE: The copying process does not re-chunk files, which may break deduplication between the files copied and files already stored in the destination repository. This means that copied files, which existed in both the source and destination repository, /may occupy up to twice their space/ in the destination repository. This can be mitigated by the “–copy-chunker-params” option when initializing a new destination repository using the “init” command.

Flags used by resticprofile only:
NameTypeDefaultNotes
initializetrue / falsefalseInitialize the secondary repository if missing
initialize-copy-chunker-paramstrue / falsetrueCopy chunker parameters when initializing the secondary repository
key-hintstringKey ID of key to try decrypting the destination repository first
password-commandstringShell command to obtain the destination repository password from
password-filestringFile to read the destination repository password from
repositorystringDestination repository to copy snapshots to
repository-filestringFile from which to read the destination repository location to copy snapshots to
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
scheduleone or more stringsSet the times at which the scheduled command is run (times are specified in systemd timer format). Examples: hourly, daily, weekly, monthly, 10:00,14:00,18:00,22:00, Wed,Fri 17:48, *-*-15 02:45, Mon..Fri 00:30
schedule-after-network-onlinetrue / falsefalseDon’t schedule the start of this profile when the network is offline (supported in “systemd”)
schedule-capture-environmentone or more stringsRESTIC_*Set names (or glob expressions) of environment variables to capture during schedule creation. The captured environment is applied prior to “profile.env” when running the schedule. Whether capturing is supported depends on the type of scheduler being used (supported in “systemd” and “launchd”)
schedule-ignore-on-batterytrue / falsefalseDon’t schedule the start of this profile when running on battery
schedule-ignore-on-battery-less-thanintegerDon’t schedule the start of this profile when running on battery, and the battery charge left is less than the value
schedule-lock-modestringdefaultSpecify how locks are used when running on schedule - see schedules/configuration/. Is one of default, fail, ignore
schedule-lock-waitinteger OR durationSet the maximum time to wait for acquiring locks when running on schedule. Examples: 150s, 15m, 30m, 45m, 1h, 2h30m
schedule-logstringRedirect the output into a log file or to syslog when running on schedule. Examples: /resticprofile.log, tcp://localhost:514
schedule-permissionstringautoSpecify whether the schedule runs with system or user privileges - see schedules/configuration/. Is one of auto, system, user, user_logged_on
schedule-prioritystringbackgroundSet the priority at which the schedule is run. Is one of background, standard
send-afterone or more nested SendMonitoringSectionSend HTTP request(s) after a successful restic command
send-after-failone or more nested SendMonitoringSectionSend HTTP request(s) after failed restic or shell commands
send-beforeone or more nested SendMonitoringSectionSend HTTP request(s) before a restic command
send-finallyone or more nested SendMonitoringSectionSend HTTP request(s) always, after all other commands
snapshotone or more stringsSnapshot IDs to copy (if empty, all snapshots are copied)
Flags passed to the restic command line:
NameTypeDefaultNotes
from-key-hintstring""key ID of key to try decrypting the source repository first (default: $RESTIC_FROM_KEY_HINT). restic >= 0.14.0
from-password-commandstring""shell command to obtain the source repository password from (default: $RESTIC_FROM_PASSWORD_COMMAND). restic >= 0.14.0
from-password-filestring""file to read the source repository password from (default: $RESTIC_FROM_PASSWORD_FILE). restic >= 0.14.0
from-repostring""source repository to copy snapshots from (default: $RESTIC_FROM_REPOSITORY). restic >= 0.14.0
from-repository-filestring""file from which to read the source repository location to copy snapshots from (default: $RESTIC_FROM_REPOSITORY_FILE). restic >= 0.14.0
hosttrue / false OR one or more hostnamesonly consider snapshots for this host. Boolean true is replaced with the hostname of the system. Examples: true, false, "host" . restic >= 0.10.0
key-hint2string""key ID of key to try decrypting the destination repository first (default: $RESTIC_KEY_HINT2). restic >= 0.10.0 < 0.14.0
password-command2string""shell command to obtain the destination repository password from (default: $RESTIC_PASSWORD_COMMAND2). restic >= 0.10.0 < 0.14.0
password-file2string""file to read the destination repository password from (default: $RESTIC_PASSWORD_FILE2). restic >= 0.10.0 < 0.14.0
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path" . restic >= 0.10.0
repo2string""destination repository to copy snapshots to (default: $RESTIC_REPOSITORY2). restic >= 0.10.0 < 0.14.0
repository-file2string""file from which to read the destination repository location to copy snapshots to (default: $RESTIC_REPOSITORY_FILE2). restic >= 0.13.0 < 0.14.0
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…]. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag" . restic >= 0.10.0

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.diff

This section configures restic command diff . Information on command and flags is copied from the restic manual pages.

The “diff” command shows differences from the first to the second snapshot. The first characters in each line display what has happened to a particular file or directory:

  • The item was added
  • The item was removed U The metadata (access mode, timestamps, …) for the item was updated M The file’s content was modified T The type was changed, e.g. a file was made a symlink
Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
metadatatrue / falsefalseprint changes in metadata

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.dump

This section configures restic command dump . Information on command and flags is copied from the restic manual pages.

The “dump” command extracts files from a snapshot from the repository. If a single file is selected, it prints its contents to stdout. Folders are output as a tar (default) or zip file containing the contents of the specified folder. Pass “/” as file name to dump the whole snapshot as an archive file.

The special snapshot “latest” can be used to use the latest snapshot in the repository.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
archivestring"tar"set archive format as “tar” or “zip”. restic >= 0.12.0
hosttrue / false OR one or more hostnamesonly consider snapshots for this host, when snapshot ID “latest” is given. Boolean true is replaced with the hostname of the system. Examples: true, false, "host"
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path, when snapshot ID “latest” is given. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path"
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…], when snapshot ID “latest” is given. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag"

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.find

This section configures restic command find . Information on command and flags is copied from the restic manual pages.

The “find” command searches for files or directories in snapshots stored in the repo. It can also be used to search for restic blobs or trees for troubleshooting.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
blobtrue / falsefalsepattern is a blob-ID
hosttrue / false OR one or more hostnamesonly consider snapshots for this host. Boolean true is replaced with the hostname of the system. Examples: true, false, "host"
human-readabletrue / falsefalseprint sizes in human readable format. restic >= 0.16.0
ignore-casetrue / falsefalseignore case for pattern
longtrue / falsefalseuse a long listing format showing size and mode
neweststring""newest modification date/time
oldeststring""oldest modification date/time
packtrue / falsefalsepattern is a pack-ID
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path"
show-pack-idtrue / falsefalsedisplay the pack-ID the blobs belong to (with –blob or –tree)
snapshotone or more stringssnapshot id to search in
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…]. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag"
treetrue / falsefalsepattern is a tree-ID

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.forget

This section configures restic command forget . Information on command and flags is copied from the restic manual pages.

The “forget” command removes snapshots according to a policy. All snapshots are first divided into groups according to “–group-by”, and after that the policy specified by the “–keep-*” options is applied to each group individually.

Please note that this command really only deletes the snapshot object in the repository, which is a reference to data stored there. In order to remove the unreferenced data after “forget” was run successfully, see the “prune” command.

Please also read the documentation for “forget” to learn about some important security considerations.

Flags used by resticprofile only:
NameTypeDefaultNotes
scheduleone or more stringsSet the times at which the scheduled command is run (times are specified in systemd timer format). Examples: hourly, daily, weekly, monthly, 10:00,14:00,18:00,22:00, Wed,Fri 17:48, *-*-15 02:45, Mon..Fri 00:30
schedule-after-network-onlinetrue / falsefalseDon’t schedule the start of this profile when the network is offline (supported in “systemd”)
schedule-capture-environmentone or more stringsRESTIC_*Set names (or glob expressions) of environment variables to capture during schedule creation. The captured environment is applied prior to “profile.env” when running the schedule. Whether capturing is supported depends on the type of scheduler being used (supported in “systemd” and “launchd”)
schedule-ignore-on-batterytrue / falsefalseDon’t schedule the start of this profile when running on battery
schedule-ignore-on-battery-less-thanintegerDon’t schedule the start of this profile when running on battery, and the battery charge left is less than the value
schedule-lock-modestringdefaultSpecify how locks are used when running on schedule - see schedules/configuration/. Is one of default, fail, ignore
schedule-lock-waitinteger OR durationSet the maximum time to wait for acquiring locks when running on schedule. Examples: 150s, 15m, 30m, 45m, 1h, 2h30m
schedule-logstringRedirect the output into a log file or to syslog when running on schedule. Examples: /resticprofile.log, tcp://localhost:514
schedule-permissionstringautoSpecify whether the schedule runs with system or user privileges - see schedules/configuration/. Is one of auto, system, user, user_logged_on
schedule-prioritystringbackgroundSet the priority at which the schedule is run. Is one of background, standard
send-afterone or more nested SendMonitoringSectionSend HTTP request(s) after a successful restic command
send-after-failone or more nested SendMonitoringSectionSend HTTP request(s) after failed restic or shell commands
send-beforeone or more nested SendMonitoringSectionSend HTTP request(s) before a restic command
send-finallyone or more nested SendMonitoringSectionSend HTTP request(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
compacttrue / falsefalseuse compact output format
dry-runtrue / falsefalsedo not delete anything, just print what would be done
group-bystringhost,pathsgroup snapshots by host, paths and/or tags, separated by comma (disable grouping with ‘’)
hosttrue / false OR one or more hostnamesonly consider snapshots for this host. Boolean true is replaced with the hostname of the system. Examples: true, false, "host"
keep-dailyinteger0keep the last n daily snapshots (use ‘unlimited’ to keep all daily snapshots)
keep-hourlyinteger0keep the last n hourly snapshots (use ‘unlimited’ to keep all hourly snapshots)
keep-lastinteger0keep the last n snapshots (use ‘unlimited’ to keep all snapshots)
keep-monthlyinteger0keep the last n monthly snapshots (use ‘unlimited’ to keep all monthly snapshots)
keep-tagone or more stringskeep snapshots with this taglist
keep-weeklyinteger0keep the last n weekly snapshots (use ‘unlimited’ to keep all weekly snapshots)
keep-withinstringkeep snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot
keep-within-dailystringkeep daily snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot. restic >= 0.13.0
keep-within-hourlystringkeep hourly snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot. restic >= 0.13.0
keep-within-monthlystringkeep monthly snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot. restic >= 0.13.0
keep-within-weeklystringkeep weekly snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot. restic >= 0.13.0
keep-within-yearlystringkeep yearly snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot. restic >= 0.13.0
keep-yearlyinteger0keep the last n yearly snapshots (use ‘unlimited’ to keep all yearly snapshots)
max-repack-sizestring""maximum size to repack (allowed suffixes: k/K, m/M, g/G, t/T). restic >= 0.12.0
max-unusedstring"5%"tolerate given limit of unused data (absolute value in bytes with suffixes k/K, m/M, g/G, t/T, a value in % or the word ‘unlimited’). restic >= 0.12.0
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path"
prunetrue / falsefalseautomatically run the ‘prune’ command if snapshots have been removed
repack-cacheable-onlytrue / falsefalseonly repack packs which are cacheable. restic >= 0.12.0
repack-smalltrue / falsefalserepack pack files below 80% of target pack size. restic >= 0.14.0
repack-uncompressedtrue / falsefalserepack all uncompressed data. restic >= 0.14.0
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…]. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag"

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.init

This section configures restic command init . Information on command and flags is copied from the restic manual pages.

The “init” command initializes a new repository.

Flags passed to the restic command line:
NameTypeDefaultNotes
copy-chunker-paramstrue / falsefalsecopy chunker parameters from the secondary repository (useful with the copy command). restic >= 0.10.0
from-key-hintstring""key ID of key to try decrypting the source repository first (default: $RESTIC_FROM_KEY_HINT). restic >= 0.14.0
from-password-commandstring""shell command to obtain the source repository password from (default: $RESTIC_FROM_PASSWORD_COMMAND). restic >= 0.14.0
from-password-filestring""file to read the source repository password from (default: $RESTIC_FROM_PASSWORD_FILE). restic >= 0.14.0
from-repositorystring""source repository to copy chunker parameters from (default: $RESTIC_FROM_REPOSITORY). restic >= 0.14.0
from-repository-filestring""file from which to read the source repository location to copy chunker parameters from (default: $RESTIC_FROM_REPOSITORY_FILE). restic >= 0.14.0
key-hint2string""key ID of key to try decrypting the secondary repository first (default: $RESTIC_KEY_HINT2). restic >= 0.10.0 < 0.14.0
password-command2string""shell command to obtain the secondary repository password from (default: $RESTIC_PASSWORD_COMMAND2). restic >= 0.10.0 < 0.14.0
password-file2string""file to read the secondary repository password from (default: $RESTIC_PASSWORD_FILE2). restic >= 0.10.0 < 0.14.0
repo2string""secondary repository to copy chunker parameters from (default: $RESTIC_REPOSITORY2). restic >= 0.10.0 < 0.14.0
repository-file2string""file from which to read the secondary repository location to copy chunker parameters from (default: $RESTIC_REPOSITORY_FILE2). restic >= 0.13.0 < 0.14.0
repository-versionstring"stable"repository format version to use, allowed values are a format version, ’latest’ and ‘stable’. restic >= 0.14.0

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.key

This section configures restic command key . Information on command and flags is copied from the restic manual pages.

The “key” command manages keys (passwords) for accessing the repository.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
hosttrue / false OR hostname""the hostname for new keys. Boolean true is replaced with the hostname of the system. Examples: true, false, "host" . restic >= 0.10.0
new-password-filestring""file from which to read the new password
userstring""the username for new keys. restic >= 0.10.0

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.list

This section configures restic command list . Information on command and flags is copied from the restic manual pages.

The “list” command allows listing objects in the repository based on type.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.ls

This section configures restic command ls . Information on command and flags is copied from the restic manual pages.

The “ls” command lists files and directories in a snapshot.

The special snapshot ID “latest” can be used to list files and directories of the latest snapshot in the repository. The –host flag can be used in conjunction to select the latest snapshot originating from a certain host only.

File listings can optionally be filtered by directories. Any positional arguments after the snapshot ID are interpreted as absolute directory paths, and only files inside those directories will be listed. If the –recursive flag is used, then the filter will allow traversing into matching directories’ subfolders. Any directory paths specified must be absolute (starting with a path separator); paths use the forward slash ‘/’ as separator.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
hosttrue / false OR one or more hostnamesonly consider snapshots for this host, when snapshot ID “latest” is given. Boolean true is replaced with the hostname of the system. Examples: true, false, "host"
human-readabletrue / falsefalseprint sizes in human readable format. restic >= 0.16.0
longtrue / falsefalseuse a long listing format showing size and mode
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path, when snapshot ID “latest” is given. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path"
recursivetrue / falsefalseinclude files in subfolders of the listed directories
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…], when snapshot ID “latest” is given. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag"

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.migrate

This section configures restic command migrate . Information on command and flags is copied from the restic manual pages.

The “migrate” command checks which migrations can be applied for a repository and prints a list with available migration names. If one or more migration names are specified, these migrations are applied.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
forcetrue / falsefalseapply a migration a second time

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.mount

This section configures restic command mount . Information on command and flags is copied from the restic manual pages.

The “mount” command mounts the repository via fuse to a directory. This is a read-only mount.

If you need a different template for directories that contain snapshots, you can pass a time template via –time-template and path templates via –path-template.

Example time template without colons:

–time-template “2006-01-02_15-04-05”

You need to specify a sample format for exactly the following timestamp:

Mon Jan 2 15:04:05 -0700 MST 2006

For details please see the documentation for time.Format() at: https://godoc.org/time#Time.Format

For path templates, you can use the following patterns which will be replaced: %i by short snapshot ID %I by long snapshot ID %u by username %h by hostname %t by tags %T by timestamp as specified by –time-template

The default path templates are: “ids/%i” “snapshots/%T” “hosts/%h/%T” “tags/%t/%T”

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
allow-othertrue / falsefalseallow other users to access the data in the mounted directory
allow-roottrue / falsefalseallow root user to access the data in the mounted directory. restic < 0.10.0
hosttrue / false OR one or more hostnamesonly consider snapshots for this host. Boolean true is replaced with the hostname of the system. Examples: true, false, "host"
no-default-permissionstrue / falsefalsefor ‘allow-other’, ignore Unix permissions and allow users to read all snapshot files
owner-roottrue / falsefalseuse ‘root’ as the owner of files and dirs
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path"
path-templateone or more stringsset template for path names. restic >= 0.14.0
snapshot-templatestring"2006-01-02T15:04:05Z07:00"set template to use for snapshot dirs. restic < 0.14.0
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…]. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag"
time-templatestring"2006-01-02T15:04:05Z07:00"set template to use for times. restic >= 0.14.0

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.prune

This section configures restic command prune . Information on command and flags is copied from the restic manual pages.

The “prune” command checks the repository and removes data that is not referenced and therefore not needed any more.

Flags used by resticprofile only:
NameTypeDefaultNotes
scheduleone or more stringsSet the times at which the scheduled command is run (times are specified in systemd timer format). Examples: hourly, daily, weekly, monthly, 10:00,14:00,18:00,22:00, Wed,Fri 17:48, *-*-15 02:45, Mon..Fri 00:30
schedule-after-network-onlinetrue / falsefalseDon’t schedule the start of this profile when the network is offline (supported in “systemd”)
schedule-capture-environmentone or more stringsRESTIC_*Set names (or glob expressions) of environment variables to capture during schedule creation. The captured environment is applied prior to “profile.env” when running the schedule. Whether capturing is supported depends on the type of scheduler being used (supported in “systemd” and “launchd”)
schedule-ignore-on-batterytrue / falsefalseDon’t schedule the start of this profile when running on battery
schedule-ignore-on-battery-less-thanintegerDon’t schedule the start of this profile when running on battery, and the battery charge left is less than the value
schedule-lock-modestringdefaultSpecify how locks are used when running on schedule - see schedules/configuration/. Is one of default, fail, ignore
schedule-lock-waitinteger OR durationSet the maximum time to wait for acquiring locks when running on schedule. Examples: 150s, 15m, 30m, 45m, 1h, 2h30m
schedule-logstringRedirect the output into a log file or to syslog when running on schedule. Examples: /resticprofile.log, tcp://localhost:514
schedule-permissionstringautoSpecify whether the schedule runs with system or user privileges - see schedules/configuration/. Is one of auto, system, user, user_logged_on
schedule-prioritystringbackgroundSet the priority at which the schedule is run. Is one of background, standard
send-afterone or more nested SendMonitoringSectionSend HTTP request(s) after a successful restic command
send-after-failone or more nested SendMonitoringSectionSend HTTP request(s) after failed restic or shell commands
send-beforeone or more nested SendMonitoringSectionSend HTTP request(s) before a restic command
send-finallyone or more nested SendMonitoringSectionSend HTTP request(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
dry-runtrue / falsefalsedo not modify the repository, just print what would be done. restic >= 0.12.0
max-repack-sizestring""maximum size to repack (allowed suffixes: k/K, m/M, g/G, t/T). restic >= 0.12.0
max-unusedstring"5%"tolerate given limit of unused data (absolute value in bytes with suffixes k/K, m/M, g/G, t/T, a value in % or the word ‘unlimited’). restic >= 0.12.0
repack-cacheable-onlytrue / falsefalseonly repack packs which are cacheable. restic >= 0.12.0
repack-smalltrue / falsefalserepack pack files below 80% of target pack size. restic >= 0.14.0
repack-uncompressedtrue / falsefalserepack all uncompressed data. restic >= 0.14.0
unsafe-recover-no-free-spacestring""UNSAFE, READ THE DOCUMENTATION BEFORE USING! Try to recover a repository stuck with no free space. Do not use without trying out ‘prune –max-repack-size 0’ first. restic >= 0.14.0

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.rebuild-index

This section configures restic command rebuild-index removed in 0.16.0 . Information on command and flags is copied from the restic manual pages.

The “rebuild-index” command creates a new index based on the pack files in the repository.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
read-all-packstrue / falsefalseread all pack files to generate new index from scratch. restic >= 0.12.0

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.recover

This section configures restic command recover . Information on command and flags is copied from the restic manual pages.

The “recover” command builds a new snapshot from all directories it can find in the raw data of the repository which are not referenced in an existing snapshot. It can be used if, for example, a snapshot has been removed by accident with “forget”.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.repair

This section configures restic command repair available since 0.16.0 . Information on command and flags is copied from the restic manual pages.

Repair the repository

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.repair-index

This section configures restic command repair-index available since 0.16.0 . Information on command and flags is copied from the restic manual pages.

The “repair index” command creates a new index based on the pack files in the repository.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
read-all-packstrue / falsefalseread all pack files to generate new index from scratch. restic >= 0.16.0

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.repair-snapshots

This section configures restic command repair-snapshots available since 0.16.0 . Information on command and flags is copied from the restic manual pages.

The “repair snapshots” command repairs broken snapshots. It scans the given snapshots and generates new ones with damaged directories and file contents removed. If the broken snapshots are deleted, a prune run will be able to clean up the repository.

The command depends on a correct index, thus make sure to run “repair index” first!

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
dry-runtrue / falsefalsedo not do anything, just print what would be done. restic >= 0.16.0
forgettrue / falsefalseremove original snapshots after creating new ones. restic >= 0.16.0
hosttrue / false OR one or more hostnamesonly consider snapshots for this host. Boolean true is replaced with the hostname of the system. Examples: true, false, "host" . restic >= 0.16.0
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path" . restic >= 0.16.0
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…]. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag" . restic >= 0.16.0

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.restore

This section configures restic command restore . Information on command and flags is copied from the restic manual pages.

The “restore” command extracts the data from a snapshot from the repository to a directory.

The special snapshot “latest” can be used to restore the latest snapshot in the repository.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
excludeone or more stringsexclude a pattern
hosttrue / false OR one or more hostnamesonly consider snapshots for this host, when snapshot ID “latest” is given. Boolean true is replaced with the hostname of the system. Examples: true, false, "host"
iexcludeone or more stringssame as –exclude but ignores the casing of filenames. restic >= 0.10.0
iincludeone or more stringssame as –include but ignores the casing of filenames. restic >= 0.10.0
includeone or more stringsinclude a pattern, exclude everything else
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path, when snapshot ID “latest” is given. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path"
sparsetrue / falsefalserestore files as sparse. restic >= 0.15.0
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…], when snapshot ID “latest” is given. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag"
targetstring""directory to extract data to
verifytrue / falsefalseverify restored files content

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.retention

This section configures restic command forget . Information on command and flags is copied from the restic manual pages.

The “forget” command removes snapshots according to a policy. All snapshots are first divided into groups according to “–group-by”, and after that the policy specified by the “–keep-*” options is applied to each group individually.

Please note that this command really only deletes the snapshot object in the repository, which is a reference to data stored there. In order to remove the unreferenced data after “forget” was run successfully, see the “prune” command.

Please also read the documentation for “forget” to learn about some important security considerations.

Flags used by resticprofile only:
NameTypeDefaultNotes
after-backuptrue / falseApply retention after the backup command succeeded. Defaults to true in configuration format v2 if any “keep-*” flag is set and “before-backup” is unset
before-backuptrue / falseApply retention before starting the backup command
scheduleone or more stringsSet the times at which the scheduled command is run (times are specified in systemd timer format). Examples: hourly, daily, weekly, monthly, 10:00,14:00,18:00,22:00, Wed,Fri 17:48, *-*-15 02:45, Mon..Fri 00:30
schedule-after-network-onlinetrue / falsefalseDon’t schedule the start of this profile when the network is offline (supported in “systemd”)
schedule-capture-environmentone or more stringsRESTIC_*Set names (or glob expressions) of environment variables to capture during schedule creation. The captured environment is applied prior to “profile.env” when running the schedule. Whether capturing is supported depends on the type of scheduler being used (supported in “systemd” and “launchd”)
schedule-ignore-on-batterytrue / falsefalseDon’t schedule the start of this profile when running on battery
schedule-ignore-on-battery-less-thanintegerDon’t schedule the start of this profile when running on battery, and the battery charge left is less than the value
schedule-lock-modestringdefaultSpecify how locks are used when running on schedule - see schedules/configuration/. Is one of default, fail, ignore
schedule-lock-waitinteger OR durationSet the maximum time to wait for acquiring locks when running on schedule. Examples: 150s, 15m, 30m, 45m, 1h, 2h30m
schedule-logstringRedirect the output into a log file or to syslog when running on schedule. Examples: /resticprofile.log, tcp://localhost:514
schedule-permissionstringautoSpecify whether the schedule runs with system or user privileges - see schedules/configuration/. Is one of auto, system, user, user_logged_on
schedule-prioritystringbackgroundSet the priority at which the schedule is run. Is one of background, standard
Flags passed to the restic command line:
NameTypeDefaultNotes
compacttrue / falsefalseuse compact output format
dry-runtrue / falsefalsedo not delete anything, just print what would be done
group-bystringhost,pathsgroup snapshots by host, paths and/or tags, separated by comma (disable grouping with ‘’)
hosttrue / false OR one or more hostnamesonly consider snapshots for this host. Boolean true is replaced with the hostname that applies in section “backup”. Defaults to true for config version 2 in “retention”. Examples: true, false, "host"
keep-dailyinteger0keep the last n daily snapshots (use ‘unlimited’ to keep all daily snapshots)
keep-hourlyinteger0keep the last n hourly snapshots (use ‘unlimited’ to keep all hourly snapshots)
keep-lastinteger0keep the last n snapshots (use ‘unlimited’ to keep all snapshots)
keep-monthlyinteger0keep the last n monthly snapshots (use ‘unlimited’ to keep all monthly snapshots)
keep-tagone or more stringskeep snapshots with this taglist
keep-weeklyinteger0keep the last n weekly snapshots (use ‘unlimited’ to keep all weekly snapshots)
keep-withinstringkeep snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot
keep-within-dailystringkeep daily snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot. restic >= 0.13.0
keep-within-hourlystringkeep hourly snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot. restic >= 0.13.0
keep-within-monthlystringkeep monthly snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot. restic >= 0.13.0
keep-within-weeklystringkeep weekly snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot. restic >= 0.13.0
keep-within-yearlystringkeep yearly snapshots that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot. restic >= 0.13.0
keep-yearlyinteger0keep the last n yearly snapshots (use ‘unlimited’ to keep all yearly snapshots)
max-repack-sizestring""maximum size to repack (allowed suffixes: k/K, m/M, g/G, t/T). restic >= 0.12.0
max-unusedstring"5%"tolerate given limit of unused data (absolute value in bytes with suffixes k/K, m/M, g/G, t/T, a value in % or the word ‘unlimited’). restic >= 0.12.0
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path. Boolean true is replaced with the paths from section “backup”. Defaults to true in “retention”. Examples: true, false, "path"
prunetrue / falsefalseautomatically run the ‘prune’ command if snapshots have been removed
repack-cacheable-onlytrue / falsefalseonly repack packs which are cacheable. restic >= 0.12.0
repack-smalltrue / falsefalserepack pack files below 80% of target pack size. restic >= 0.14.0
repack-uncompressedtrue / falsefalserepack all uncompressed data. restic >= 0.14.0
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…]. Boolean true is replaced with the tags from section “backup”. Defaults to true for config version 2 in “retention”. Examples: true, false, "tag"

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.rewrite

This section configures restic command rewrite available since 0.15.0 . Information on command and flags is copied from the restic manual pages.

The “rewrite” command excludes files from existing snapshots. It creates new snapshots containing the same data as the original ones, but without the files you specify to exclude. All metadata (time, host, tags) will be preserved.

The snapshots to rewrite are specified using the –host, –tag and –path options, or by providing a list of snapshot IDs. Please note that specifying neither any of these options nor a snapshot ID will cause the command to rewrite all snapshots.

The special tag ‘rewrite’ will be added to the new snapshots to distinguish them from the original ones, unless –forget is used. If the –forget option is used, the original snapshots will instead be directly removed from the repository.

Please note that the –forget option only removes the snapshots and not the actual data stored in the repository. In order to delete the no longer referenced data, use the “prune” command.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
dry-runtrue / falsefalsedo not do anything, just print what would be done. restic >= 0.15.0
excludeone or more stringsexclude a pattern. restic >= 0.15.0
exclude-fileone or more stringsread exclude patterns from a file. restic >= 0.15.0
forgettrue / falsefalseremove original snapshots after creating new ones. restic >= 0.15.0
hosttrue / false OR one or more hostnamesonly consider snapshots for this host. Boolean true is replaced with the hostname of the system. Examples: true, false, "host" . restic >= 0.15.0
iexcludeone or more stringssame as –exclude pattern but ignores the casing of filenames. restic >= 0.15.0
iexclude-fileone or more stringssame as –exclude-file but ignores casing of filenames in patterns. restic >= 0.15.0
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path" . restic >= 0.15.0
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…]. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag" . restic >= 0.15.0

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.snapshots

This section configures restic command snapshots . Information on command and flags is copied from the restic manual pages.

The “snapshots” command lists all snapshots stored in the repository.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
compacttrue / falsefalseuse compact output format
group-bystringgroup snapshots by host, paths and/or tags, separated by comma. restic >= 0.10.0
hosttrue / false OR one or more hostnamesonly consider snapshots for this host. Boolean true is replaced with the hostname of the system. Examples: true, false, "host"
lasttrue / falsefalseonly show the last snapshot for each host and path. restic < 0.13.0
latestinteger0only show the last n snapshots for each host and path. restic >= 0.13.0
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path"
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…]. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag"

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.stats

This section configures restic command stats . Information on command and flags is copied from the restic manual pages.

The “stats” command walks one or multiple snapshots in a repository and accumulates statistics about the data stored therein. It reports on the number of unique files and their sizes, according to one of the counting modes as given by the –mode flag.

It operates on all snapshots matching the selection criteria or all snapshots if nothing is specified. The special snapshot ID “latest” is also supported. Some modes make more sense over just a single snapshot, while others are useful across all snapshots, depending on what you are trying to calculate.

The modes are:

restore-size: (default) Counts the size of the restored files. files-by-contents: Counts total size of files, where a file is considered unique if it has unique contents. raw-data: Counts the size of blobs in the repository, regardless of how many files reference them. blobs-per-file: A combination of files-by-contents and raw-data.

Refer to the online manual for more details about each mode.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
hosttrue / false OR one or more hostnamesonly consider snapshots for this host. Boolean true is replaced with the hostname of the system. Examples: true, false, "host"
modestring"restore-size"counting mode: restore-size (default), files-by-contents, blobs-per-file or raw-data
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path" . restic >= 0.10.0
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…]. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag" . restic >= 0.10.0

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.tag

This section configures restic command tag . Information on command and flags is copied from the restic manual pages.

The “tag” command allows you to modify tags on exiting snapshots.

You can either set/replace the entire set of tags on a snapshot, or add tags to/remove tags from the existing set.

When no snapshot-ID is given, all snapshots matching the host, tag and path filter criteria are modified.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
addone or more stringstags which will be added to the existing tags in the format tag[,tag,…]
hosttrue / false OR one or more hostnamesonly consider snapshots for this host. Boolean true is replaced with the hostname of the system. Examples: true, false, "host"
pathtrue / false OR one or more stringsonly consider snapshots including this (absolute) path. Boolean true is replaced with the paths from section “backup”. Examples: true, false, "path"
removeone or more stringstags which will be removed from the existing tags in the format tag[,tag,…]
setone or more stringstags which will replace the existing tags in the format tag[,tag,…]
tagtrue / false OR one or more stringsonly consider snapshots including tag[,tag,…]. Boolean true is replaced with the tags from section “backup”. Examples: true, false, "tag"

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Section profile.unlock

This section configures restic command unlock . Information on command and flags is copied from the restic manual pages.

The “unlock” command removes stale locks that have been created by other restic processes.

Flags used by resticprofile only:
NameTypeDefaultNotes
run-afterone or more stringsRun shell command(s) after a successful restic command
run-after-failone or more stringsRun shell command(s) after failed restic or shell commands
run-beforeone or more stringsRun shell command(s) before a restic command
run-finallyone or more stringsRun shell command(s) always, after all other commands
Flags passed to the restic command line:
NameTypeDefaultNotes
remove-alltrue / falsefalseremove all locks, even non-stale ones

Flags declared for the restic command line in section profile can be overridden in this section.

go to top

Nested profile sections

Nested sections describe configuration structure that is assigned to flags within the configuration, see HTTP Hooks as an example.

Nested SendMonitoringHeader

NameTypeDefaultNotes
namestringName of the HTTP header. Examples: "Authorization", "Cache-Control", "Content-Disposition", "Content-Type"
valuestringValue of the header. Examples: "Bearer ...", "Basic ...", "no-cache", "attachment; filename=stats.txt", "application/json", "text/plain", "text/xml"

Nested SendMonitoringSection

NameTypeDefaultNotes
bodystringRequest body, overrides “body-template”
body-templatestringPath to a file containing the request body (go template). See configuration/http_hooks/#body-template
headersone or more nested SendMonitoringHeaderAdditional HTTP headers to send with the request
methodstringGETHTTP method of the request. Is one of GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT, TRACE
skip-tls-verificationtrue / falsefalseEnables insecure TLS (without verification), see also “global.ca-certificates”
urluriURL of the target to send to

Nested StreamErrorSection

NameTypeDefaultNotes
max-runsinteger0Maximum amount of times that “run” is started ; 0 for no limit. Must be >= 0
min-matchesinteger0Minimum amount of times the “pattern” must match before “run” is started ; 0 for no limit. Must be >= 0
patternregexA regular expression pattern that is tested against stderr of a running restic command
runstringThe shell command to run when the pattern matches

go to top

Section groups

Config file format v1 uses a simplified groups section. Every named item below groups maps to one or more profile names (list of strings).

From file format v2, every named item in the groups section is configuration structure following the format described below (see Configuration v2 for details):

NameTypeDefaultNotes
continue-on-errortrue / falseautoContinue with the next profile on a failure, overrides “global.group-continue-on-error”
descriptionstringDescribe the group
profilesone or more stringsNames of the profiles belonging to this group

go to top

Value types

Type: true / false
Is a boolean value to toggle a flag or specific behaviour that has to match the syntax for booleans in the used file format.
Type: numeric & integer
Is a numeric value (whole-number for integer) that has to match the syntax for numbers in the used file format.
Type: string
Is a sequence of UTF-8 characters that usually have to be placed in quotes and must match the syntax for strings in the used file format.
Type: duration
A duration string is a sequence of decimal numbers, each with optional fraction and a unit suffix, such as “300ms”, “-1.5h” or “2h45m”. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”.
Type: uri
An uri string must be a valid URI or URL.
Type: hostname
A hostname string must be a valid hostname or FQDN.
Type: one or more [type]s
Indicates that multiple values of [type] can be specified as a list. The list syntax depends on the used file format.
Type: one or more nested [type]
Is a value or a list of values that follow the configuration structure declared in [type].
Type: key => [type]
Is a value that is configuration structure of string keys and values of [type].
Type: key => value
Is a value that is configuration structure of string keys and values of any type.

go to top

JSON schema

resticprofile provides a JSON schema for v1 & v2 configuration files. The schema may be used to validate configuration files in JSON format (and possibly others), see JSON schema for details.

JSON schema URLs for any restic version:

JSON schema URLs for a specific restic version:

  • .../config-1-restic-{MAJOR}-{MINOR}.json
  • .../config-2-restic-{MAJOR}-{MINOR}.json

Available URLs:

go to top