mirror of
https://github.com/rustic-rs/rustic.git
synced 2025-10-26 11:18:51 +00:00
Use rustic_core development version (#1476)
This commit is contained in:
parent
cad87d8084
commit
2ec2644a93
1382
Cargo.lock
generated
1382
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -57,8 +57,8 @@ rustdoc-args = ["--document-private-items", "--generate-link-to-definition"]
|
||||
|
||||
[dependencies]
|
||||
abscissa_core = { version = "0.8.1", default-features = false, features = ["application"] }
|
||||
rustic_backend = { version = "0.5.2", features = ["cli"] }
|
||||
rustic_core = { version = "0.7.2", features = ["cli"] }
|
||||
rustic_backend = { git = "https://github.com/rustic-rs/rustic_core.git", features = ["cli"] }
|
||||
rustic_core = { git = "https://github.com/rustic-rs/rustic_core.git", features = ["cli"] }
|
||||
|
||||
# allocators
|
||||
jemallocator-global = { version = "0.3.2", optional = true }
|
||||
@ -144,7 +144,7 @@ pretty_assertions = "1.4"
|
||||
quickcheck = "1"
|
||||
quickcheck_macros = "1"
|
||||
rstest = "0.23"
|
||||
rustic_testing = "0.3.2"
|
||||
rustic_testing = { git = "https://github.com/rustic-rs/rustic_core.git" }
|
||||
tar = "0.4.43"
|
||||
tempfile = "3.14"
|
||||
toml = "0.8"
|
||||
|
||||
@ -118,18 +118,19 @@ All given labels are reported to the Promethus Pushgateway, if it is configured.
|
||||
|
||||
### Repository Options `[repository]`
|
||||
|
||||
| Attribute | Description | Default Value | Example Value | Environment Variable | CLI Option |
|
||||
| ---------------- | ---------------------------------------------------------- | ------------------------ | ---------------------- | ----------------------- | ------------------- |
|
||||
| cache-dir | Path to the cache directory. | ~/.cache/rustic/$REPO_ID | ~/.cache/my_own_cache/ | RUSTIC_CACHE_DIR | --cache-dir |
|
||||
| no-cache | If true, disables caching. | false | | RUSTIC_NO_CACHE | --no-cache |
|
||||
| repository | The path to the repository. Required. | Not set | "/tmp/rustic" | RUSTIC_REPOSITORY | --repositoy, -r |
|
||||
| repo-hot | The path to the hot repository. | Not set | | RUSTIC_REPO_HOT | --repo-hot |
|
||||
| password | The password for the repository. | Not set | "mySecretPassword" | RUSTIC_PASSWORD | --password |
|
||||
| password-file | Path to a file containing the password for the repository. | Not set | | RUSTIC_PASSWORD_FILE | --password-file, -p |
|
||||
| password-command | Command to retrieve the password for the repository. | Not set | | RUSTIC_PASSWORD_COMMAND | --password-command |
|
||||
| warm-up | If true, warms up the repository by file access. | false | | | ---warm-up |
|
||||
| warm-up-command | Command to warm up the repository. | Not set | | | --warm-up-command |
|
||||
| warm-up-wait | The wait time for warming up the repository. | Not set | | | --warm-up-wait |
|
||||
| Attribute | Description | Default Value | Example Value | Environment Variable | CLI Option |
|
||||
| -------------------- | ---------------------------------------------------------- | ------------------------ | ---------------------- | ----------------------- | ---------------------- |
|
||||
| cache-dir | Path to the cache directory. | ~/.cache/rustic/$REPO_ID | ~/.cache/my_own_cache/ | RUSTIC_CACHE_DIR | --cache-dir |
|
||||
| no-cache | If true, disables caching. | false | | RUSTIC_NO_CACHE | --no-cache |
|
||||
| repository | The path to the repository. Required. | Not set | "/tmp/rustic" | RUSTIC_REPOSITORY | --repositoy, -r |
|
||||
| repo-hot | The path to the hot repository. | Not set | | RUSTIC_REPO_HOT | --repo-hot |
|
||||
| password | The password for the repository. | Not set | "mySecretPassword" | RUSTIC_PASSWORD | --password |
|
||||
| password-file | Path to a file containing the password for the repository. | Not set | | RUSTIC_PASSWORD_FILE | --password-file, -p |
|
||||
| password-command | Command to retrieve the password for the repository. | Not set | | RUSTIC_PASSWORD_COMMAND | --password-command |
|
||||
| warm-up | If true, warms up the repository by file access. | false | | | ---warm-up |
|
||||
| warm-up-command | Command to warm up the repository. | Not set | | | --warm-up-command |
|
||||
| warm-up-wait | The wait time for warming up the repository. | Not set | | | --warm-up-wait |
|
||||
| warm-up-wait-command | Command to run to wait for packs to be warmed-up. | Not set | | | --warm-up-wait-command |
|
||||
|
||||
### Repository Options (Additional) `[repository.options]`
|
||||
|
||||
@ -188,41 +189,41 @@ See [Global Hooks](#global-hooks-globalhooks).
|
||||
**Note**: If set here, the backup options apply for all sources, although they
|
||||
can be overwritten in the source-specific configuration, see below.
|
||||
|
||||
| Attribute | Description | Default Value | Example Value | CLI Option |
|
||||
| --------------------- | -------------------------------------------------------------------------------------------- | --------------------- | ------------- | ----------------------- |
|
||||
| as-path | Specifies the path for the backup when the source contains a single path. | Not set | | --as-path |
|
||||
| command | Set the command saved in the snapshot. | The full command used | | --command |
|
||||
| custom-ignorefiles | Array of names of custom ignorefiles which will be used to exclude files. | [] | | --custom-ignorefile |
|
||||
| description | Description for the snapshot. | Not set | | --description |
|
||||
| description-from | Path to a file containing the description for the snapshot. | Not set | | --description-from |
|
||||
| delete-never | If true, never delete the snapshot. | false | | --delete-never |
|
||||
| delete-after | Time duration after which the snapshot be deleted. | Not set | | --delete-after |
|
||||
| exclude-if-present | Array of filenames to exclude from the backup if they are present. | [] | | --exclude-if-present |
|
||||
| force | If true, forces the backup even if no changes are detected. | false | | --force |
|
||||
| git-ignore | If true, use .gitignore rules to exclude files from the backup in the source directory. | false | | --git-ignore |
|
||||
| globs | Array of globs specifying what to include/exclude in the backup. | [] | | --glob |
|
||||
| glob-files | Array or string of glob files specifying what to include/exclude in the backup. | [] | | --glob-file |
|
||||
| group-by | Grouping strategy to find parent snapshot. | "host,label,paths" | | --group-by |
|
||||
| host | Host name used in the snapshot. | local hostname | | --host |
|
||||
| iglobs | Like glob, but apply case-insensitive | [] | | --iglob |
|
||||
| iglob-files | Like glob-file, but apply case-insensitive | [] | | --iglob-file |
|
||||
| ignore-devid | If true, don't save device ID. | false | | --ignore-devid |
|
||||
| ignore-ctime | If true, ignore file change time (ctime). | false | | --ignore-ctime |
|
||||
| ignore-inode | If true, ignore file inode for the backup. | false | | --ignore-inode |
|
||||
| init | If true, initialize repository if it doesn't exist, yet. | false | | --init |
|
||||
| json | If true, returns output of the command as json. | false | | --json |
|
||||
| label | Set label for the snapshot. | Not set | | --label |
|
||||
| no-require-git | (with git-ignore:) Apply .git-ignore files even if they are not in a git repository. | false | | --no-require-git |
|
||||
| no-scan | Don't scan the backup source for its size (disables ETA). | false | | --no-scan |
|
||||
| one-file-system | If true, only backs up files from the same filesystem as the source. | false | | --one-file-system |
|
||||
| parent | Parent snapshot ID for the backup. | Not set | | --parent |
|
||||
| quiet | Don't output backup summary. | false | | --quiet |
|
||||
| skip-identical-parent | Skip saving of the snapshot if it is identical to the parent. | false | | --skip-identical-parent |
|
||||
| stdin-filename | File name to be used when reading from stdin. | Not set | | --stdin-filename |
|
||||
| tags | Array of tags for the backup. | [] | | --tag |
|
||||
| time | Set the time saved in the snapshot. | current time | | --time |
|
||||
| with-atime | If true, includes file access time (atime) in the backup. | false | | --with-atime |
|
||||
| prometheus-job | jobname used when pushing to the Prometheus Pushgateway (if global prometheus option is set) | "rustic-backup" | "myjob" | --prometheus-job |
|
||||
| Attribute | Description | Default Value | Example Value | CLI Option |
|
||||
| ------------------ | -------------------------------------------------------------------------------------------- | --------------------- | ------------- | -------------------- |
|
||||
| as-path | Specifies the path for the backup when the source contains a single path. | Not set | | --as-path |
|
||||
| command | Set the command saved in the snapshot. | The full command used | | --command |
|
||||
| custom-ignorefiles | Array of names of custom ignorefiles which will be used to exclude files. | [] | | --custom-ignorefile |
|
||||
| description | Description for the snapshot. | Not set | | --description |
|
||||
| description-from | Path to a file containing the description for the snapshot. | Not set | | --description-from |
|
||||
| delete-never | If true, never delete the snapshot. | false | | --delete-never |
|
||||
| delete-after | Time duration after which the snapshot be deleted. | Not set | | --delete-after |
|
||||
| exclude-if-present | Array of filenames to exclude from the backup if they are present. | [] | | --exclude-if-present |
|
||||
| force | If true, forces the backup even if no changes are detected. | false | | --force |
|
||||
| git-ignore | If true, use .gitignore rules to exclude files from the backup in the source directory. | false | | --git-ignore |
|
||||
| globs | Array of globs specifying what to include/exclude in the backup. | [] | | --glob |
|
||||
| glob-files | Array or string of glob files specifying what to include/exclude in the backup. | [] | | --glob-file |
|
||||
| group-by | Grouping strategy to find parent snapshot. | "host,label,paths" | | --group-by |
|
||||
| host | Host name used in the snapshot. | local hostname | | --host |
|
||||
| iglobs | Like glob, but apply case-insensitive | [] | | --iglob |
|
||||
| iglob-files | Like glob-file, but apply case-insensitive | [] | | --iglob-file |
|
||||
| ignore-devid | If true, don't save device ID. | false | | --ignore-devid |
|
||||
| ignore-ctime | If true, ignore file change time (ctime). | false | | --ignore-ctime |
|
||||
| ignore-inode | If true, ignore file inode for the backup. | false | | --ignore-inode |
|
||||
| init | If true, initialize repository if it doesn't exist, yet. | false | | --init |
|
||||
| json | If true, returns output of the command as json. | false | | --json |
|
||||
| label | Set label for the snapshot. | Not set | | --label |
|
||||
| no-require-git | (with git-ignore:) Apply .git-ignore files even if they are not in a git repository. | false | | --no-require-git |
|
||||
| no-scan | Don't scan the backup source for its size (disables ETA). | false | | --no-scan |
|
||||
| one-file-system | If true, only backs up files from the same filesystem as the source. | false | | --one-file-system |
|
||||
| parent | Parent snapshot ID for the backup. | Not set | | --parent |
|
||||
| quiet | Don't output backup summary. | false | | --quiet |
|
||||
| skip-if-unchanged | Skip saving of the snapshot if it is identical to the parent. | false | | --skip-if-unchanged |
|
||||
| stdin-filename | File name to be used when reading from stdin. | Not set | | --stdin-filename |
|
||||
| tags | Array of tags for the backup. | [] | | --tag |
|
||||
| time | Set the time saved in the snapshot. | current time | | --time |
|
||||
| with-atime | If true, includes file access time (atime) in the backup. | false | | --with-atime |
|
||||
| prometheus-job | jobname used when pushing to the Prometheus Pushgateway (if global prometheus option is set) | "rustic-backup" | "myjob" | --prometheus-job |
|
||||
|
||||
### Backup Hooks `[backup.hooks]`
|
||||
|
||||
@ -278,6 +279,7 @@ hooks when backing up the defined sources into a snapshot.
|
||||
| keep-tags | Keep snapshots containing one of these taglists. | [] | ["keep", "important" ] | --keep-tags |
|
||||
| keep-ids | Keep snapshots containing one of these IDs. | [] | ["6e58f3d32" ] | --keep-id |
|
||||
| keep-none | Allow to keep no snapshots. | false | true | --keep-none |
|
||||
| delete-unchanged | Remove snapshots which are unchanged w.r.t their parent. | false | true | --delete-unchanged |
|
||||
| prune | If set to true, prune the repository after snapshots have been removed. | false | | --prune |
|
||||
|
||||
Additionally extra snapshot filter options can be given for the `forget` command
|
||||
|
||||
@ -52,6 +52,7 @@ cache-dir = "/my/rustic/cachedir" # Default: Applications default cache dir, e.g
|
||||
warm-up = false
|
||||
warm-up-command = "warmup.sh %id" # Default: not set
|
||||
warm-up-wait = "10min" # Default: not set
|
||||
warm-up-wait-command = "warmup_wait.sh" # 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
|
||||
@ -136,7 +137,7 @@ json = false
|
||||
init = false
|
||||
no-scan = false
|
||||
quiet = false
|
||||
skip-identical-parent = false
|
||||
skip-if-unchanged = false
|
||||
prometheus-job = "my-backup-jobs" # Only used if global prometheus option is set; default: not set
|
||||
|
||||
# Backup hooks: The given commands are called for the `backup` command
|
||||
@ -211,6 +212,7 @@ keep-within-monthly = "1 year"
|
||||
keep-within-quarter-yearly = "0 year"
|
||||
keep-within-half-yearly = "1 year"
|
||||
keep-within-yearly = "10 years"
|
||||
delete-unchanged = false
|
||||
|
||||
[copy]
|
||||
targets = ["profile1", "profile2"] # Default: []
|
||||
|
||||
@ -107,6 +107,7 @@ allow = [
|
||||
"Zlib",
|
||||
"Unicode-3.0",
|
||||
"BSL-1.0",
|
||||
"CDLA-Permissive-2.0",
|
||||
]
|
||||
# The confidence threshold for detecting a license from license text.
|
||||
# The higher the value, the more closely the license text must be to the
|
||||
|
||||
@ -51,7 +51,7 @@ json = false
|
||||
long = false
|
||||
quiet = false
|
||||
init = false
|
||||
skip-identical-parent = false
|
||||
skip-if-unchanged = false
|
||||
force = false
|
||||
ignore-ctime = false
|
||||
ignore-inode = false
|
||||
|
||||
@ -42,6 +42,7 @@ RusticConfig {
|
||||
cache_dir: None,
|
||||
warm_up: false,
|
||||
warm_up_command: None,
|
||||
warm_up_wait_command: None,
|
||||
warm_up_wait: None,
|
||||
},
|
||||
hooks: Hooks {
|
||||
@ -83,7 +84,7 @@ RusticConfig {
|
||||
parent_opts: ParentOptions {
|
||||
group_by: None,
|
||||
parent: None,
|
||||
skip_identical_parent: false,
|
||||
skip_if_unchanged: false,
|
||||
force: false,
|
||||
ignore_ctime: false,
|
||||
ignore_inode: false,
|
||||
@ -191,6 +192,7 @@ RusticConfig {
|
||||
keep_within_half_yearly: None,
|
||||
keep_within_yearly: None,
|
||||
keep_none: false,
|
||||
delete_unchanged: false,
|
||||
},
|
||||
},
|
||||
mount: None,
|
||||
|
||||
@ -61,7 +61,7 @@ json = false
|
||||
long = false
|
||||
quiet = false
|
||||
init = false
|
||||
skip-identical-parent = false
|
||||
skip-if-unchanged = false
|
||||
force = false
|
||||
ignore-ctime = false
|
||||
ignore-inode = false
|
||||
|
||||
@ -53,6 +53,7 @@ RusticConfig {
|
||||
cache_dir: None,
|
||||
warm_up: false,
|
||||
warm_up_command: None,
|
||||
warm_up_wait_command: None,
|
||||
warm_up_wait: None,
|
||||
},
|
||||
hooks: Hooks {
|
||||
@ -94,7 +95,7 @@ RusticConfig {
|
||||
parent_opts: ParentOptions {
|
||||
group_by: None,
|
||||
parent: None,
|
||||
skip_identical_parent: false,
|
||||
skip_if_unchanged: false,
|
||||
force: false,
|
||||
ignore_ctime: false,
|
||||
ignore_inode: false,
|
||||
@ -202,6 +203,7 @@ RusticConfig {
|
||||
keep_within_half_yearly: None,
|
||||
keep_within_yearly: None,
|
||||
keep_none: false,
|
||||
delete_unchanged: false,
|
||||
},
|
||||
},
|
||||
mount: None,
|
||||
|
||||
@ -61,7 +61,7 @@ json = false
|
||||
long = false
|
||||
quiet = false
|
||||
init = false
|
||||
skip-identical-parent = false
|
||||
skip-if-unchanged = false
|
||||
force = false
|
||||
ignore-ctime = false
|
||||
ignore-inode = false
|
||||
|
||||
@ -49,13 +49,13 @@ fn setup() -> TestResult<TempDir> {
|
||||
#[test]
|
||||
fn test_backup_and_check_passes() -> TestResult<()> {
|
||||
let temp_dir = setup()?;
|
||||
let backup = src_snapshot()?.into_path().into_path();
|
||||
let backup = src_snapshot()?.into_path();
|
||||
|
||||
{
|
||||
// Run `backup` for the first time
|
||||
rustic_runner(&temp_dir)?
|
||||
.arg("backup")
|
||||
.arg(&backup)
|
||||
.arg(backup.path())
|
||||
.assert()
|
||||
.success()
|
||||
.stderr(predicate::str::contains("successfully saved."));
|
||||
@ -74,7 +74,7 @@ fn test_backup_and_check_passes() -> TestResult<()> {
|
||||
// Run `backup` a second time
|
||||
rustic_runner(&temp_dir)?
|
||||
.arg("backup")
|
||||
.arg(backup)
|
||||
.arg(backup.path())
|
||||
.assert()
|
||||
.success()
|
||||
.stderr(predicate::str::contains("Added to the repo: 0 B"))
|
||||
@ -107,13 +107,13 @@ fn test_backup_and_check_passes() -> TestResult<()> {
|
||||
fn test_backup_and_restore_passes() -> TestResult<()> {
|
||||
let temp_dir = setup()?;
|
||||
let restore_dir = temp_dir.path().join("restore");
|
||||
let backup_files = src_snapshot()?.into_path().into_path();
|
||||
let backup_files = src_snapshot()?.into_path();
|
||||
|
||||
{
|
||||
// Run `backup` for the first time
|
||||
rustic_runner(&temp_dir)?
|
||||
.arg("backup")
|
||||
.arg(&backup_files)
|
||||
.arg(backup_files.path())
|
||||
.arg("--as-path")
|
||||
.arg("/")
|
||||
.assert()
|
||||
@ -132,7 +132,7 @@ fn test_backup_and_restore_passes() -> TestResult<()> {
|
||||
}
|
||||
|
||||
// Compare the backup and the restored directory
|
||||
let compare_result = Comparison::default().compare(&backup_files, &restore_dir)?;
|
||||
let compare_result = Comparison::default().compare(backup_files.path(), &restore_dir)?;
|
||||
|
||||
// no differences
|
||||
assert!(compare_result.is_empty());
|
||||
|
||||
@ -51,7 +51,7 @@ json = false
|
||||
long = false
|
||||
quiet = false
|
||||
init = false
|
||||
skip-identical-parent = false
|
||||
skip-if-unchanged = false
|
||||
force = false
|
||||
ignore-ctime = false
|
||||
ignore-inode = false
|
||||
|
||||
@ -1,100 +0,0 @@
|
||||
---
|
||||
source: tests/show-config.rs
|
||||
assertion_line: 35
|
||||
expression: output
|
||||
snapshot_kind: text
|
||||
---
|
||||
[global]
|
||||
use-profiles = []
|
||||
dry-run = false
|
||||
check-index = false
|
||||
no-progress = false
|
||||
|
||||
[global.hooks]
|
||||
run-before = []
|
||||
run-after = []
|
||||
run-failed = []
|
||||
run-finally = []
|
||||
|
||||
[global.env]
|
||||
|
||||
[global.prometheus-labels]
|
||||
|
||||
[repository]
|
||||
repository = "local:/tmp/repo"
|
||||
password = "testx"
|
||||
no-cache = false
|
||||
warm-up = false
|
||||
|
||||
[repository.options]
|
||||
|
||||
[repository.options-hot]
|
||||
|
||||
[repository.options-cold]
|
||||
|
||||
[repository.hooks]
|
||||
run-before = [
|
||||
"echo before",
|
||||
"echo before1",
|
||||
]
|
||||
run-after = []
|
||||
run-failed = []
|
||||
run-finally = []
|
||||
|
||||
[snapshot-filter]
|
||||
filter-hosts = []
|
||||
filter-labels = []
|
||||
filter-paths = []
|
||||
filter-paths-exact = []
|
||||
filter-tags = []
|
||||
filter-tags-exact = []
|
||||
|
||||
[backup]
|
||||
stdin-filename = ""
|
||||
with-atime = false
|
||||
ignore-devid = false
|
||||
no-scan = false
|
||||
json = false
|
||||
long = false
|
||||
quiet = false
|
||||
init = false
|
||||
skip-identical-parent = false
|
||||
force = false
|
||||
ignore-ctime = false
|
||||
ignore-inode = false
|
||||
globs = []
|
||||
iglobs = []
|
||||
glob-files = []
|
||||
iglob-files = []
|
||||
git-ignore = false
|
||||
no-require-git = false
|
||||
custom-ignorefiles = []
|
||||
exclude-if-present = []
|
||||
one-file-system = false
|
||||
tags = []
|
||||
delete-never = false
|
||||
snapshots = []
|
||||
sources = []
|
||||
|
||||
[backup.hooks]
|
||||
run-before = []
|
||||
run-after = []
|
||||
run-failed = []
|
||||
run-finally = []
|
||||
|
||||
[backup.prometheus-labels]
|
||||
|
||||
[copy]
|
||||
targets = []
|
||||
|
||||
[forget]
|
||||
prune = false
|
||||
filter-hosts = []
|
||||
filter-labels = []
|
||||
filter-paths = []
|
||||
filter-paths-exact = []
|
||||
filter-tags = []
|
||||
filter-tags-exact = []
|
||||
|
||||
[webdav]
|
||||
symlinks = false
|
||||
Loading…
Reference in New Issue
Block a user