2022-03-25 23:15:41 +00:00
|
|
|
Enhancement: Add `--dry-run`/`-n` option to `backup` command
|
backup: add --dry-run/-n flag to show what would happen.
This can be used to check how large a backup is or validate exclusions.
It does not actually write any data to the underlying backend. This is
implemented as a simple overlay backend that accepts writes without
forwarding them, passes through reads, and generally does the minimal
necessary to pretend that progress is actually happening.
Fixes #1542
Example usage:
$ restic -vv --dry-run . | grep add
new /changelog/unreleased/issue-1542, saved in 0.000s (350 B added)
modified /cmd/restic/cmd_backup.go, saved in 0.000s (16.543 KiB added)
modified /cmd/restic/global.go, saved in 0.000s (0 B added)
new /internal/backend/dry/dry_backend_test.go, saved in 0.000s (3.866 KiB added)
new /internal/backend/dry/dry_backend.go, saved in 0.000s (3.744 KiB added)
modified /internal/backend/test/tests.go, saved in 0.000s (0 B added)
modified /internal/repository/repository.go, saved in 0.000s (20.707 KiB added)
modified /internal/ui/backup.go, saved in 0.000s (9.110 KiB added)
modified /internal/ui/jsonstatus/status.go, saved in 0.001s (11.055 KiB added)
modified /restic, saved in 0.131s (25.542 MiB added)
Would add to the repo: 25.892 MiB
2019-06-13 03:39:13 +00:00
|
|
|
|
2022-03-25 23:15:41 +00:00
|
|
|
Testing exclude filters and other configuration options was error prone as
|
|
|
|
wrong filters could cause files to be uploaded unintentionally. It was also
|
|
|
|
not possible to estimate beforehand how much data would be uploaded.
|
2021-07-30 21:02:02 +00:00
|
|
|
|
2022-03-25 23:15:41 +00:00
|
|
|
The `backup` command now has a `--dry-run`/`-n` option, which performs all the
|
|
|
|
normal steps of a backup without actually writing anything to the repository.
|
|
|
|
|
|
|
|
Passing -vv will log information about files that would be added, allowing for
|
|
|
|
verification of source and exclusion options before running the real backup.
|
backup: add --dry-run/-n flag to show what would happen.
This can be used to check how large a backup is or validate exclusions.
It does not actually write any data to the underlying backend. This is
implemented as a simple overlay backend that accepts writes without
forwarding them, passes through reads, and generally does the minimal
necessary to pretend that progress is actually happening.
Fixes #1542
Example usage:
$ restic -vv --dry-run . | grep add
new /changelog/unreleased/issue-1542, saved in 0.000s (350 B added)
modified /cmd/restic/cmd_backup.go, saved in 0.000s (16.543 KiB added)
modified /cmd/restic/global.go, saved in 0.000s (0 B added)
new /internal/backend/dry/dry_backend_test.go, saved in 0.000s (3.866 KiB added)
new /internal/backend/dry/dry_backend.go, saved in 0.000s (3.744 KiB added)
modified /internal/backend/test/tests.go, saved in 0.000s (0 B added)
modified /internal/repository/repository.go, saved in 0.000s (20.707 KiB added)
modified /internal/ui/backup.go, saved in 0.000s (9.110 KiB added)
modified /internal/ui/jsonstatus/status.go, saved in 0.001s (11.055 KiB added)
modified /restic, saved in 0.131s (25.542 MiB added)
Would add to the repo: 25.892 MiB
2019-06-13 03:39:13 +00:00
|
|
|
|
|
|
|
https://github.com/restic/restic/issues/1542
|
|
|
|
https://github.com/restic/restic/pull/2308
|
2021-02-23 19:10:08 +00:00
|
|
|
https://github.com/restic/restic/pull/3210
|
|
|
|
https://github.com/restic/restic/pull/3300
|