New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip archiver.Scan before backup when --quiet is set #1676

merged 1 commit into from Mar 21, 2018


None yet
3 participants
Copy link

bowensong commented Mar 20, 2018

What is the purpose of this change? What does it change?

This PR ensures the backup command skips the archiver.Scan() before the backup actually starts when the quiet flag -q or --quiet is set.

The reason behind the change is because the scan result is only used for displaying the progress bar and ETA estimation, but the scan result is not used when the quiet flag is set.

By skipping the scan before backup, the backup speed improves on large directory trees, especially when the entire directory tree cannot entirely fit into page cache, in which case the directory tree was twice read from the disk before this change is made.

Was the change discussed in an issue or in the forum before?

See issue #1160

I don't think this PR completely closes the above issue. This is only a quick change to improve the backup performance in some use cases with a minimal change in the code and logic.


  • I have read the Contribution Guidelines
  • I have added tests for all changes in this PR
  • I have added documentation for the changes (in the manual)
  • There's a new file in changelog/unreleased/ that describes the changes for our users (template here)
  • I have run gofmt on the code in all commits
  • All commit messages are formatted in the same style as the other commits in the repo
  • I'm done, this Pull Request is ready for review

This comment has been minimized.

Copy link

codecov-io commented Mar 20, 2018

Codecov Report

Merging #1676 into master will decrease coverage by 4.45%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1676      +/-   ##
- Coverage    51.6%   47.14%   -4.46%     
  Files         143      143              
  Lines       11392    11394       +2     
- Hits         5879     5372     -507     
- Misses       4606     5154     +548     
+ Partials      907      868      -39
Impacted Files Coverage Δ
cmd/restic/cmd_backup.go 37.31% <60%> (+8.12%) ⬆️
internal/backend/azure/azure.go 0% <0%> (-82.15%) ⬇️
internal/backend/swift/swift.go 0% <0%> (-78.45%) ⬇️
internal/backend/b2/b2.go 0% <0%> (-77.73%) ⬇️
internal/backend/gs/gs.go 0% <0%> (-73.61%) ⬇️
internal/backend/swift/config.go 36.95% <0%> (-54.35%) ⬇️
internal/backend/s3/s3.go 60.76% <0%> (-2.31%) ⬇️
internal/archiver/archiver.go 64.25% <0%> (+0.21%) ⬆️
internal/backend/test/tests.go 60.87% <0%> (+0.65%) ⬆️
internal/checker/checker.go 69.62% <0%> (+3.97%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a524da...34671d7. Read the comment docs.


fd0 approved these changes Mar 21, 2018

Copy link

fd0 left a comment

LGTM, thanks!

@fd0 fd0 merged commit 34671d7 into restic:master Mar 21, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
hound No violations found. Woof!

fd0 added a commit that referenced this pull request Mar 21, 2018

Merge pull request #1676 from bowensong/quiet-skip-scan
Skip archiver.Scan before backup when --quiet is set

@mlissner mlissner referenced this pull request Apr 14, 2018


Set up restic for offsite backups #821

9 of 10 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment