backup

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 strings OR nested ScheduleConfigConfigures the scheduled execution of this profile section. Can be times in systemd timer format or a config structure. 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 / falseDon’t start this schedule 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 start this schedule when running on battery
schedule-ignore-on-battery-less-thanintegerDon’t start this schedule when running on battery and the state of charge is less than this percentage. Examples: 20, 33, 50, 75
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, syslog-tcp://syslog-server:514, syslog:server, syslog:
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%
source-relativetrue / falsefalseEnable backup with relative source paths. This will change the working directory of the “restic backup” command to “source-base”, and will not expand “source” to an absolute path
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.