forked from TrueCloudLab/restic
resolve rawtaz's review comments
make majority of suggestions from review by @rawtaz verbatim, with one clarification on my part in changelog
This commit is contained in:
parent
d107a2cfdf
commit
4126435663
3 changed files with 8 additions and 7 deletions
|
@ -1,9 +1,10 @@
|
||||||
Enhancement: Add --dry-run/-n option to backup command.
|
Enhancement: Add --dry-run/-n option to backup command
|
||||||
|
|
||||||
We added a new --dry-run/-n option to backup, which performs all the normal
|
We added a new --dry-run/-n option to the backup command, which performs
|
||||||
steps of a backup without actually writing data. Passing -vv will log
|
all the normal steps of a backup without actually writing any changes to
|
||||||
information about files that would be added, allowing fast verification of
|
the repository. Passing -vv will log information about files that would
|
||||||
backup options without any unnecessary write activity.
|
be added, allowing verification of source and exclusion backup options
|
||||||
|
without committing changes to the repository.
|
||||||
|
|
||||||
https://github.com/restic/restic/issues/1542
|
https://github.com/restic/restic/issues/1542
|
||||||
https://github.com/restic/restic/pull/2308
|
https://github.com/restic/restic/pull/2308
|
||||||
|
|
|
@ -133,10 +133,10 @@ func init() {
|
||||||
f.BoolVar(&backupOptions.WithAtime, "with-atime", false, "store the atime for all files and directories")
|
f.BoolVar(&backupOptions.WithAtime, "with-atime", false, "store the atime for all files and directories")
|
||||||
f.BoolVar(&backupOptions.IgnoreInode, "ignore-inode", false, "ignore inode number changes when checking for modified files")
|
f.BoolVar(&backupOptions.IgnoreInode, "ignore-inode", false, "ignore inode number changes when checking for modified files")
|
||||||
f.BoolVar(&backupOptions.IgnoreCtime, "ignore-ctime", false, "ignore ctime changes when checking for modified files")
|
f.BoolVar(&backupOptions.IgnoreCtime, "ignore-ctime", false, "ignore ctime changes when checking for modified files")
|
||||||
|
f.BoolVarP(&backupOptions.DryRun, "dry-run", "n", false, "do not upload or write any data, just show what would be done")
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
f.BoolVar(&backupOptions.UseFsSnapshot, "use-fs-snapshot", false, "use filesystem snapshot where possible (currently only Windows VSS)")
|
f.BoolVar(&backupOptions.UseFsSnapshot, "use-fs-snapshot", false, "use filesystem snapshot where possible (currently only Windows VSS)")
|
||||||
}
|
}
|
||||||
f.BoolVarP(&backupOptions.DryRun, "dry-run", "n", false, "do not write anything, just print what would be done")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// filterExisting returns a slice of all existing items, or an error if no
|
// filterExisting returns a slice of all existing items, or an error if no
|
||||||
|
|
|
@ -199,7 +199,7 @@ Combined with ``--verbose``, you can see a list of changes:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ restic -r /srv/restic-repo backup ~/work --dry-run -vv | grep added
|
$ restic -r /srv/restic-repo backup ~/work --dry-run -vv | grep "added)$"
|
||||||
modified /plan.txt, saved in 0.000s (9.110 KiB added)
|
modified /plan.txt, saved in 0.000s (9.110 KiB added)
|
||||||
modified /archive.tar.gz, saved in 0.140s (25.542 MiB added)
|
modified /archive.tar.gz, saved in 0.140s (25.542 MiB added)
|
||||||
Would be added to the repo: 25.551 MiB
|
Would be added to the repo: 25.551 MiB
|
||||||
|
|
Loading…
Add table
Reference in a new issue