Skip to content

Commit

Permalink
feat: Add documentation for minutely timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jullanggit committed Nov 29, 2024
1 parent 8b9bd0f commit ad6e6f5
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 57 deletions.
2 changes: 2 additions & 0 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,15 @@ hooks when backing up the defined sources into a snapshot.
| -------------------------- | ----------------------------------------------------------------------- | ------------------ | ---------------------- | ---------------------------- |
| group-by | Group snapshots by given criteria before applying keep policies. | "host,label,paths" | | --group-by |
| keep-last | Number of most recent snapshots to keep. | Not set | 15 | --keep-last, -l |
| keep-minutely, -M | Number of minutely snapshots to keep. | Not set | | --keep-minutely |
| keep-hourly, -H | Number of hourly snapshots to keep. | Not set | | --keep-hourly |
| keep-daily, -d | Number of daily snapshots to keep. | Not set | 8 | --keep-daily |
| keep-weekly, -w | Number of weekly snapshots to keep. | Not set | | --keep-weekly |
| keep-monthly, -m | Number of monthly snapshots to keep. | Not set | | --keep-monthly |
| keep-quarter-yearly | Number of quarter-yearly snapshots to keep. | Not set | | --keep-quarter-yearly |
| keep-half-yearly | Number of half-yearly snapshots to keep. | Not set | | --keep-half-yearly |
| keep-yearly, -y | Number of yearly snapshots to keep. | Not set | | --keep-yearly |
| keep-within-minutely | The time duration within which minutely snapshots will be kept. | Not set | "2 hours" | --keep-within-minutely |
| keep-within-hourly | The time duration within which hourly snapshots will be kept. | Not set | "1 day" | --keep-within-hourly |
| keep-within-daily | The time duration within which daily snapshots will be kept. | Not set | "7 days" | --keep-within-daily |
| keep-within-weekly | The time duration within which weekly snapshots will be kept. | Not set | | --keep-within-weekly |
Expand Down
118 changes: 61 additions & 57 deletions config/full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Global options: These options are used for all commands.
[global]
use-profiles = []
log-level = "info" # any of "off", "error", "warn", "info", "debug", "trace"; default: "info"
log-level = "info" # any of "off", "error", "warn", "info", "debug", "trace"; default: "info"
log-file = "/path/to/rustic.log" # Default: not set
no-progress = false
progress-interval = "100ms"
Expand All @@ -20,7 +20,9 @@ check-index = false
[global.hooks]
run-before = [
# long form giving command and args explicitly and allow to specify failure behavior
{ command = "echo", args = ["before"], on-failure = "warn" }, # allowed values for on-failure: "error" (default), "warn", "ignore"
{ command = "echo", args = [
"before",
], on-failure = "warn" }, # allowed values for on-failure: "error" (default), "warn", "ignore"
] # Default: []
run-after = ["echo after"] # Run after if successful, short version, default: []
run-failed = ["echo failed"] # Default: []
Expand All @@ -35,31 +37,31 @@ RCLONE_XXX = "true"
# Repository options: These options define which backend to use and which password to use.
[repository]
repository = "/repo/rustic" # Must be set
repo-hot = "/my/hot/repo" # Default: not set
repo-hot = "/my/hot/repo" # Default: not set
# one of the three password options must be set
password = "mySecretPassword"
password-file = "/my/password.txt"
password-command = "my_command.sh"
no-cache = false
cache-dir = "/my/rustic/cachedir" # Default: Applications default cache dir, e.g. ~/.cache/rustic
cache-dir = "/my/rustic/cachedir" # Default: Applications default cache dir, e.g. ~/.cache/rustic
# use either warm-up (warm-up by file access) or warm-up-command to specify warming up
warm-up = false
warm-up-command = "warmup.sh %id" # Default: not set
warm-up-wait = "10min" # Default: not set
warm-up-wait = "10min" # Default: not set

# Additional repository options - depending on backend. These can be only set in the config file or using env variables.
# For env variables use upper snake case and prefix with "RUSTIC_REPO_OPT_", e.g. `use-passwort = "true"` becomes
# `RUSTIC_REPO_OPT_USE_PASSWORT=true`
[repository.options]
post-create-command = "par2create -qq -n1 -r5 %file" # Only local backend; Default: not set
post-delete-command = "sh -c \"rm -f %file*.par2\"" # Only local backend; Default: not set
retry = "default" # Only rest/rclone/all opendal backends; Allowed values: "false"/"off", "default" or number of retries
timeout = "10min" # Only rest/rclone backend
post-create-command = "par2create -qq -n1 -r5 %file" # Only local backend; Default: not set
post-delete-command = "sh -c \"rm -f %file*.par2\"" # Only local backend; Default: not set
retry = "default" # Only rest/rclone/all opendal backends; Allowed values: "false"/"off", "default" or number of retries
timeout = "10min" # Only rest/rclone backend
rclone-command = "rclone serve restic --addr localhost:0" # Only rclone; Default: not set
use-password = "true" # Only rclone
rest-url = "http://localhost:8000" # Only rclone; Default: determine REST URL from rclone output
connections = "20" # Only opendal backends; Default: Not set
throttle = "10kB,10MB" # limit and burst per second; only opendal backends; Default: Not set
use-password = "true" # Only rclone
rest-url = "http://localhost:8000" # Only rclone; Default: determine REST URL from rclone output
connections = "20" # Only opendal backends; Default: Not set
throttle = "10kB,10MB" # limit and burst per second; only opendal backends; Default: Not set
# Note that opendal backends use several service-dependent options which may be specified here, see
# https://opendal.apache.org/docs/rust/opendal/services/index.html

Expand All @@ -77,42 +79,42 @@ throttle = "10kB,10MB" # limit and burst per second; only opendal backends; Defa

# Repository hooks: The given commands are called for commands accessing the repository.
[repository.hooks]
run-before = ["echo before"] # Default: []
run-after = ["echo after"] # Run after if successful, default: []
run-failed = ["echo failed"] # Default: []
run-before = ["echo before"] # Default: []
run-after = ["echo after"] # Run after if successful, default: []
run-failed = ["echo failed"] # Default: []
run-finally = ["echo finally"] # Always run after, default: []

# Snapshot-filter options: These options apply to all commands that use snapshot filters
[snapshot-filter]
filter-hosts = ["host1", "host2"] # Default: []
filter-labels = ["label1", "label2"] # Default: []
filter-tags = ["tag1,tag2", "tag3"] # Default: []
filter-tags-exact = ["tag1,tag2", "tag2"] # Default: []
filter-paths = ["path1", "path2,path3"] # Default: []
filter-paths-exact = ["path1", "path2,path3"] # Default: []
filter-after = "2024-01-01" # Default: not set
filter-before = "2024-02-05 12:15" # Default: not set
filter-size = "200MiB" # Default: not set
filter-size-added = "1 MB..10MB" # Default: not set
filter-hosts = ["host1", "host2"] # Default: []
filter-labels = ["label1", "label2"] # Default: []
filter-tags = ["tag1,tag2", "tag3"] # Default: []
filter-tags-exact = ["tag1,tag2", "tag2"] # Default: []
filter-paths = ["path1", "path2,path3"] # Default: []
filter-paths-exact = ["path1", "path2,path3"] # Default: []
filter-after = "2024-01-01" # Default: not set
filter-before = "2024-02-05 12:15" # Default: not set
filter-size = "200MiB" # Default: not set
filter-size-added = "1 MB..10MB" # Default: not set
filter-fn = '|sn| {sn.host == "host1" || sn.description.contains("test")}' # Default: no filter function

# Backup options: These options are used for all sources when calling the backup command.
# They can be overwritten by source-specific options (see below) or command line options.
[backup]
label = "label" # Default: not set
label = "label" # Default: not set
tags = ["tag1", "tag2"]
description = "my description" # Default: not set
description-from = "/path/to/description.txt" # Default: not set
description = "my description" # Default: not set
description-from = "/path/to/description.txt" # Default: not set
delete-never = false
delete-after = "5d" # Default: not set
host = "manually_set_host" # Default: host name
group-by = "host,label,paths" # Can be any combination of host,label,paths,tags
parent = "123abc" # Default: not set
delete-after = "5d" # Default: not set
host = "manually_set_host" # Default: host name
group-by = "host,label,paths" # Can be any combination of host,label,paths,tags
parent = "123abc" # Default: not set
force = false
ignore-ctime = false
ignore-inode = false
stdin-filename = "stdin" # Only for stdin source
as-path = "/my/path" # Default: not set; Note: This only works if source contains of a single path.
stdin-filename = "stdin" # Only for stdin source
as-path = "/my/path" # Default: not set; Note: This only works if source contains of a single path.
with-atime = false
ignore-devid = false
globs = []
Expand All @@ -121,10 +123,10 @@ glob-files = []
iglob-files = []
git-ignore = false
no-require-git = false
exclude-if-present = [".nobackup", "CACHEDIR.TAG"] # Default: not set
exclude-if-present = [".nobackup", "CACHEDIR.TAG"] # Default: not set
custom-ignorefiles = [".rusticignore", ".backupignore"] # Default: not set
one-file-system = false
exclude-larger-than = "100MB" # Default: not set
exclude-larger-than = "100MB" # Default: not set
json = false
init = false
no-scan = false
Expand All @@ -133,22 +135,22 @@ skip-identical-parent = false

# Backup hooks: The given commands are called for the `backup` command
[backup.hooks]
run-before = ["echo before"] # Default: []
run-after = ["echo after"] # Run after if successful, default: []
run-failed = ["echo failed"] # Default: []
run-before = ["echo before"] # Default: []
run-after = ["echo after"] # Run after if successful, default: []
run-failed = ["echo failed"] # Default: []
run-finally = ["echo finally"] # Always run after, default: []

# Backup options for specific sources - all above options are also available here and replace them for the given source
[[backup.snapshots]]
sources = ["/path/to/source1"]
label = "label" # Default: not set
label = "label" # Default: not set
# .. and so on. see [backup]

# Source-specific hooks: The given commands when backing up the defined source
[backup.snapshots.hooks]
run-before = ["echo before"] # Default: []
run-after = ["echo after"] # Run after if successful, default: []
run-failed = ["echo failed"] # Default: []
run-before = ["echo before"] # Default: []
run-after = ["echo after"] # Run after if successful, default: []
run-failed = ["echo failed"] # Default: []
run-finally = ["echo finally"] # Always run after, default: []

[[backup.snapshots]]
Expand All @@ -163,16 +165,16 @@ sources = [
prune = false
group-by = "host,label,paths" # Can be any combination of host,label,paths,tags
# The following filter options can be also defined here and then overwrite the options for the forget command
filter-hosts = ["host1", "host2"] # Default: []
filter-labels = ["label1", "label2"] # Default: []
filter-tags = ["tag1,tag2", "tag3"] # Default: []
filter-tags-exact = ["tag1,tag2", "tag2"] # Default: []
filter-paths = ["path1", "path2,path3"] # Default: []
filter-paths-exact = ["path1", "path2,path3"] # Default: []
filter-after = "2024-01-01" # Default: not set
filter-before = "2024-02-05 12:15" # Default: not set
filter-size = "200MiB" # Default: not set
filter-size-added = "1 MB..10MB" # Default: not set
filter-hosts = ["host1", "host2"] # Default: []
filter-labels = ["label1", "label2"] # Default: []
filter-tags = ["tag1,tag2", "tag3"] # Default: []
filter-tags-exact = ["tag1,tag2", "tag2"] # Default: []
filter-paths = ["path1", "path2,path3"] # Default: []
filter-paths-exact = ["path1", "path2,path3"] # Default: []
filter-after = "2024-01-01" # Default: not set
filter-before = "2024-02-05 12:15" # Default: not set
filter-size = "200MiB" # Default: not set
filter-size-added = "1 MB..10MB" # Default: not set
filter-fn = '|sn| {sn.host == "host1" || sn.description.contains("test")}' # Default: no filter function
# The retention options follow. All of these are not set by default.
keep-tags = ["tag1", "tag2,tag3"] # Default: not set
Expand All @@ -181,13 +183,15 @@ keep-ids = [
"11122233",
] # Keep all snapshots whose ID starts with any of these strings, default: not set
keep-last = 0
keep-minutely = 10
keep-daily = 3
keep-weekly = 0
keep-monthly = 0
keep-quarter-yearly = 0
keep-half-yearly = 0
keep-yearly = 10
keep-within = "0s"
keep-within-minutely = "2 hours"
keep-within-daily = "0 seconds"
keep-within-weekly = "2 months"
keep-within-monthly = "1 year"
Expand All @@ -201,10 +205,10 @@ targets = ["profile1", "profile2"] # Default: []
[webdav]
address = "localhost:8000"
path-template = "[{hostname}]/[{label}]/{time}" # The path template to use for snapshots. {id}, {id_long}, {time}, {username}, {hostname}, {label}, {tags}, {backup_start}, {backup_end} are replaced. [default: "[{hostname}]/[{label}]/{time}"]. Only relevant if no snapshot-path is given.
time-template = "%Y-%m-%d_%H-%M-%S" # only relevant if no snapshot-path is given
time-template = "%Y-%m-%d_%H-%M-%S" # only relevant if no snapshot-path is given
symlinks = false
file-access = "read" # Default: "forbidden" for hot/cold repos, else "read"
snapshot-path = "latest:/dir" # Default: not set - if not set, generate a virtual tree with all snapshots using path-template
file-access = "read" # Default: "forbidden" for hot/cold repos, else "read"
snapshot-path = "latest:/dir" # Default: not set - if not set, generate a virtual tree with all snapshots using path-template

[mount]
path-template = "[{hostname}]/[{label}]/{time}" # The path template to use for snapshots. {id}, {id_long}, {time}, {username}, {hostname}, {label}, {tags}, {backup_start}, {backup_end} are replaced. [default: "[{hostname}]/[{label}]/{time}"]. Only relevant if no snapshot-path is given.
Expand Down

0 comments on commit ad6e6f5

Please sign in to comment.