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:
erin 2021-01-02 09:00:06 -08:00 committed by Michael Eischer
parent d107a2cfdf
commit 4126435663
3 changed files with 8 additions and 7 deletions

View File

@ -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
steps of a backup without actually writing data. Passing -vv will log
information about files that would be added, allowing fast verification of
backup options without any unnecessary write activity.
We added a new --dry-run/-n option to the backup command, which performs
all the normal steps of a backup without actually writing any changes to
the repository. Passing -vv will log information about files that would
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/pull/2308

View File

@ -133,10 +133,10 @@ func init() {
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.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" {
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

View File

@ -199,7 +199,7 @@ Combined with ``--verbose``, you can see a list of changes:
.. 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 /archive.tar.gz, saved in 0.140s (25.542 MiB added)
Would be added to the repo: 25.551 MiB