forget

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 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
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.