Commit Graph

59 Commits

Author SHA1 Message Date
Winfried Plappert 7566069bf3 docs: amend restic find documentation (#21818)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-05-31 16:31:44 +02:00
Michael Eischer e212076f71 doc: correctly use RST backticks
RST uses double backticks for inline code unlike the single backticks in
Markdown.
2026-05-15 23:37:54 +02:00
Michael Eischer 75f92f22d9 doc: unify section headings to gerund phrases
Use -ing headings for sections across the user manual.
2026-05-15 23:37:54 +02:00
Michael Eischer 4c9a07e9c8 doc: stick to second-persion "you" in user docs
Replace usages of `we`, `one` and "it is possible" with the mainly used `you`.
2026-05-15 23:13:29 +02:00
Michael Eischer bd7f3483ac doc: clarify repository setup for copy 2026-05-15 22:43:09 +02:00
Michael Eischer f6c8751575 doc: consistency fixes 2026-05-15 22:42:29 +02:00
Michael Eischer 2419c03177 doc: fix several typos 2026-05-15 22:25:51 +02:00
Michael Eischer 8abbc3703d doc: update embedded help output and misc typos (#21804) 2026-05-15 20:21:04 +02:00
Michael Eischer 93357440da doc: describe effects of relative paths on snapshot structure 2026-05-10 17:34:42 +02:00
Winfried Plappert c5e09ae9b1 docs: expand restic find - documentation (#5675) 2026-02-19 18:07:05 +00:00
Winfried Plappert 5148608c39 restic rewrite include - based on restic 0.18.1
cmd/restic/cmd_rewrite.go:
introduction of include filters for this command:
- add include filters, add error checking code
- add new parameter 'keepEmptyDirectoryFunc' to 'walker.NewSnapshotSizeRewriter()',
  so empty directories have to be kept to keep the directory structure intact
- add parameter 'keepEmptySnapshot' to 'filterAndReplaceSnapshot()' to keep snapshots
  intact when nothing is to be included
- introduce helper function 'gatherIncludeFilters()' and 'gatherExcludeFilters()' to
  keep code flow clean

cmd/restic/cmd_rewrite_integration_test.go:
add several new tests around the 'include' functionality

internal/filter/include.go:
this is where is include filter is defined

internal/walker/rewriter.go:
- struct RewriteOpts gains field 'KeepEmtpyDirectory', which is a 'NodeKeepEmptyDirectoryFunc()'
  which defaults to nil, so that al subdirectories are kept
- function 'NewSnapshotSizeRewriter()' gains the parameter 'keepEmptyDirecoryFilter' which
  controls the management of empty subdirectories in case of include filters active

internal/data/tree.go:
gains a function Count() for checking the number if node elements in a newly built tree

internal/walker/rewriter_test.go:
function 'NewSnapshotSizeRewriter()' gets an additional parameter nil to keeps things happy

cmd/restic/cmd_repair_snapshots.go:
function 'filterAndReplaceSnapshot()' gets an additional parameter 'keepEmptySnapshot=nil'

doc/045_working_with_repos.rst:
gets to mention include filters

changelog/unreleased/issue-4278:
the usual announcement file

git rebase master -i produced this

restic rewrite include - keep linter happy

cmd/restic/cmd_rewrite_integration_test.go:
linter likes strings.Contain() better than my strings.Index() >= 0
2026-01-31 19:42:56 +00:00
Michael Eischer f9e5660e75 output which source and target snapshot belong together 2025-11-23 22:01:53 +01:00
Michael Eischer 7d08c9282a align docs 2025-11-23 17:51:07 +01:00
Winfried Plappert b87f7586e4 restic copy --batch: a fresh start from commit 382616747
Instead of rebasing my code, I decided to start fresh, since WithBlobUploader()
has been introduced.

changelog/unreleased/issue-5453:
doc/045_working_with_repos.rst:
the usual

cmd/restic/cmd_copy.go:
gather all snaps to be collected - collectAllSnapshots()
run overall copy step - func copyTreeBatched()
helper copySaveSnapshot() to save the corresponding snapshot

internal/repository/repack.go:
introduce wrapper CopyBlobs(), which passes parameter `uploader restic.BlobSaver` from
WithBlobUploader() via copyTreeBatched() to repack().

internal/backend/local/local_windows.go:
I did not touch it, but gofmt did: whitespace
2025-11-19 07:09:24 +00:00
Lyall Cooper e30acefbff Fix typo in rewrite command note 2025-09-24 14:40:35 +09:00
Markus Hansmair 287b601f01 doc: typo & minor rewording in 'Removing files from snapshots' 2025-04-16 09:37:26 +02:00
Winfried Plappert 4104a8e6a5 Issue: 4942: cmd_rewrite: add snapshot summary data to an existing snapshot. (#5185)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2025-02-05 20:40:20 +01:00
Winfried Plappert 060a44202f ls: sort output by size, atime, ctime, mtime, time(=mtime), extension (#5182)
Enhancement: create ability to sort output of restic ls -l by
name, size, atime, ctime, mtime, time(=mtime), X(=extension), extension

---------

Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2025-02-03 22:07:04 +01:00
Michael Eischer 828c8bc1e8 doc: describe how to handle rewrite encoding error 2024-08-26 14:41:09 +02:00
Michael Eischer 283038056e doc: suggest to follow troubleshooting steps if check reports error 2024-07-05 20:04:25 +02:00
Ikko Eltociear Ashimine a60643de9c docs: update 045_working_with_repos.rst
colums -> columns
2024-07-03 14:31:11 +09:00
Michael Eischer 513135b238 doc: slightly modernize backup examples 2024-05-30 15:25:44 +02:00
Michael Eischer 6a13e451b1 document snapshot statistics 2024-02-23 22:32:04 +01:00
Michael Eischer 10e71af759 describe ls command in docs 2024-01-27 13:22:00 +01:00
Michael Eischer c7844530d8 update docs 2024-01-06 20:25:24 +01:00
Michael Manganiello 045aa64558 cmd/copy: Prefix hostname to snapshot display output
This change better resembles the output generated by `Snapshot.String()`,
which includes both username and hostname.

Closes #4506

Before:

```
$ restic copy --from-repo /srv/restic-repo
repository 3666882b opened (version 2, compression level auto)
repository 0085c387 opened (version 2, compression level auto)
created new cache in /home/mike/.cache/restic
[0:00] 100.00%  1 / 1 index files loaded
[0:00]          0 index files loaded

snapshot 32b39a20 of [/home/mike/data] at 2023-10-21 16:01:13.979948154 -0300 -03)
  copy started, this may take a while...
[0:00] 100.00%  1 / 1 packs copied
snapshot 10331fdd saved
```

After:

```
$ restic copy --from-repo /srv/restic-repo
repository 3666882b opened (version 2, compression level auto)
repository 0085c387 opened (version 2, compression level auto)
[0:00] 100.00%  1 / 1 index files loaded
[0:00]          0 index files loaded

snapshot 32b39a20 of [/home/mike/data] at 2023-10-21 16:01:13.979948154 -0300 -03 by mike@desktop)
  copy started, this may take a while...
[0:00] 100.00%  1 / 1 packs copied
snapshot a67bd1ee saved
```
2024-01-06 20:20:46 +01:00
Michael Eischer 01b33734ab rewrite: update command output in docs 2023-12-24 15:36:22 +01:00
Gabriel Kabbe 7de97d7480 rewrite: Add documentation 2023-12-24 15:36:22 +01:00
Giuseppe D'Andrea a128976014 docs: fix typo in working with repos
When using the `copy` command, `--from-password-file` and `--from-password-command` flags are used to specify the password of the source repository, not of the destination repository.
2023-12-24 01:04:36 +01:00
Martin Michlmayr 41e6a02bcc Fix typos 2023-10-27 18:56:32 +02:00
Refutable4890 aa86c76aab Add a description of the resumption of copy 2023-10-08 12:07:40 +08:00
Refutable4890 e09f6f540f Add a description of the resumption of copy 2023-08-08 12:51:40 +08:00
Michael Eischer 8dcb0c4a9d doc: improve description of caching behavior of the check command 2023-06-17 22:18:50 +02:00
Michael Eischer 6a793db9ca rewrite: fix link anchors in documentation 2022-11-27 16:38:10 +01:00
Leo R. Lundgren f175da2756 rewrite: Polish documentation 2022-11-12 19:55:22 +01:00
Michael Eischer 11b8c3a158 rewrite: add documentation 2022-11-12 19:55:22 +01:00
Rob Hoelz 03e9a26018 Update copy documentation to use --from-repo option
Removing the last references to the deprecated --repo2 option
2022-10-07 22:00:12 +02:00
Michael Eischer 2758d76b77 copy: replace --repo2 with --from-repo
`init` and `copy` use `--repo2` with two different meaning which has
proven to be confusing for users. `--from-repo` now consistently marks a
source repository from which data is read. `--repo` is now always the
target/destination repository.
2022-08-19 18:33:26 +02:00
MichaelEischer d71b29221b Merge pull request #3822 from JsBergbau/doc-max-compression
Added hint for --compression max in migration process
2022-07-12 23:02:45 +02:00
Michael Eischer 71ff6b77f0 doc: Rework hint to repack with max compression 2022-07-12 21:24:40 +02:00
Michael Eischer ec4dfa3c66 Wording: replace further repo occurrences with repository 2022-07-12 20:48:01 +02:00
JsBergbau 8d3f04aefa Added hint for --compression max in migration process
Added hint for --compression max in migration process. Since this is a onetime process users should be aware of this and consider this step.
2022-07-12 00:08:26 +02:00
Michael Eischer 4faff0debe doc: Describe repository upgrade process 2022-05-09 22:31:30 +02:00
Leo R. Lundgren c7d637ec39 check: Adjust help and documentation for check --read-data-subset 2022-03-26 00:11:04 +01:00
Gautam Menghani 836fbb9133 [#issue 3490] Support for specifying file size in read-data-subset 2021-11-02 15:25:46 +05:30
Wouter Horlings 9ccdba9df6 Add repositoryFile2 option
The `init` and `copy` commands can now use `--repository-file2` flag and
the `$RESTIC_REPOSITORY_FILE2` environment variable.

This also fixes the conflict with the `--repository-file` and `--repo2`
flag.

Tests are added for the initSecondaryGlobalOpts function.

This adds a NOK function to the test helper functions. This NOK tests if
err is not nil, and otherwise fail the test.

With the NOK function a couple of sad paths are tested in the
initSecondaryGlobalOpts function.

In total the tests checks wether the following are passed correct:
   - Password
   - PasswordFile
   - Repo
   - RepositoryFile

The following situation must return an error to pass the test:
   - no Repo or RepositoryFile defined
   - Repo and RepositoryFile defined both
2021-03-08 22:41:13 +01:00
Leo R. Lundgren f70b10d0ee doc: Emphasize double transfer and duplication in copy command 2020-11-28 19:49:34 +01:00
fgma 8f9cea8cc0 Check data subset: check random percentage subset 2020-11-15 18:13:50 +01:00
Michael Eischer f003410402 init: Add --copy-chunker-params option
This allows creating multiple repositories with identical chunker
parameters which is required for working deduplication when copying
snapshots between different repositories.
2020-09-19 16:53:05 +02:00
Michael Eischer 91e8d998cd Add documentation for copy command 2020-08-29 10:48:44 +02:00