From d6e3c7f28e3f01abe336bdb768b181b8ee3e52b7 Mon Sep 17 00:00:00 2001 From: Lorenz Bausch Date: Sat, 7 May 2022 22:23:59 +0200 Subject: [PATCH 1/3] Wording: change repo to repository --- cmd/restic/cmd_backup.go | 2 +- cmd/restic/cmd_recover.go | 4 ++-- cmd/restic/global.go | 6 +++--- doc/060_forget.rst | 2 +- doc/cache.rst | 6 +++--- doc/faq.rst | 6 +++--- doc/manual_rest.rst | 8 ++++---- internal/backend/location/location.go | 2 +- internal/repository/repository.go | 4 ++-- internal/ui/backup/text.go | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cmd/restic/cmd_backup.go b/cmd/restic/cmd_backup.go index c9c0d5e91..2f50085fc 100644 --- a/cmd/restic/cmd_backup.go +++ b/cmd/restic/cmd_backup.go @@ -111,7 +111,7 @@ func init() { cmdRoot.AddCommand(cmdBackup) f := cmdBackup.Flags() - f.StringVar(&backupOptions.Parent, "parent", "", "use this parent `snapshot` (default: last snapshot in the repo that has the same target files/directories, and is not newer than the snapshot time)") + f.StringVar(&backupOptions.Parent, "parent", "", "use this parent `snapshot` (default: last snapshot in the repository that has the same target files/directories, and is not newer than the snapshot time)") f.BoolVarP(&backupOptions.Force, "force", "f", false, `force re-reading the target files/directories (overrides the "parent" flag)`) f.StringArrayVarP(&backupOptions.Excludes, "exclude", "e", nil, "exclude a `pattern` (can be specified multiple times)") f.StringArrayVar(&backupOptions.InsensitiveExcludes, "iexclude", nil, "same as --exclude `pattern` but ignores the casing of filenames") diff --git a/cmd/restic/cmd_recover.go b/cmd/restic/cmd_recover.go index 42cabaa68..1eeba54e3 100644 --- a/cmd/restic/cmd_recover.go +++ b/cmd/restic/cmd_recover.go @@ -140,12 +140,12 @@ func runRecover(gopts GlobalOptions) error { var err error treeID, err = repo.SaveTree(ctx, tree) if err != nil { - return errors.Fatalf("unable to save new tree to the repo: %v", err) + return errors.Fatalf("unable to save new tree to the repository: %v", err) } err = repo.Flush(ctx) if err != nil { - return errors.Fatalf("unable to save blobs to the repo: %v", err) + return errors.Fatalf("unable to save blobs to the repository: %v", err) } return nil }) diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 600ee48aa..3d240886d 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -118,7 +118,7 @@ func init() { f.StringVar(&globalOptions.TLSClientCertKeyFilename, "tls-client-cert", "", "path to a `file` containing PEM encoded TLS client certificate and private key") f.BoolVar(&globalOptions.InsecureTLS, "insecure-tls", false, "skip TLS certificate verification when connecting to the repo (insecure)") f.BoolVar(&globalOptions.CleanupCache, "cleanup-cache", false, "auto remove old cache directories") - f.Var(&globalOptions.Compression, "compression", "compression mode (only available for repo format version 2), one of (auto|off|max)") + f.Var(&globalOptions.Compression, "compression", "compression mode (only available for repository format version 2), one of (auto|off|max)") f.IntVar(&globalOptions.Limits.UploadKb, "limit-upload", 0, "limits uploads to a maximum rate in KiB/s. (default: unlimited)") f.IntVar(&globalOptions.Limits.DownloadKb, "limit-download", 0, "limits downloads to a maximum rate in KiB/s. (default: unlimited)") f.StringSliceVarP(&globalOptions.Options, "option", "o", []string{}, "set extended option (`key=value`, can be specified multiple times)") @@ -470,7 +470,7 @@ func OpenRepository(opts GlobalOptions) (*repository.Repository, error) { id = id[:8] } if !opts.JSON { - Verbosef("repository %v opened (repo version %v) successfully, password is correct\n", id, s.Config().Version) + Verbosef("repository %v opened (repository version %v) successfully, password is correct\n", id, s.Config().Version) } } @@ -712,7 +712,7 @@ func open(s string, gopts GlobalOptions, opts options.Options) (restic.Backend, } if err != nil { - return nil, errors.Fatalf("unable to open repo at %v: %v", location.StripPassword(s), err) + return nil, errors.Fatalf("unable to open repository at %v: %v", location.StripPassword(s), err) } // wrap backend if a test specified an inner hook diff --git a/doc/060_forget.rst b/doc/060_forget.rst index df9491c5e..36de1b2cc 100644 --- a/doc/060_forget.rst +++ b/doc/060_forget.rst @@ -420,7 +420,7 @@ The ``prune`` command accepts the following options: used by your repository, pass ``0`` to this option. * As a size relative to the total repo size (e.g. ``10%``). This means that after prune, at most ``10%`` of the total data stored in the repo may be - unused data. If the repo after prune has a size of 500MB, then at most + unused data. If the repository after prune has a size of 500MB, then at most 50MB may be unused. * If the string ``unlimited`` is passed, there is no limit for partly unused files. This means that as long as some data is still used within diff --git a/doc/cache.rst b/doc/cache.rst index 30b601faf..7b1cabebb 100644 --- a/doc/cache.rst +++ b/doc/cache.rst @@ -7,7 +7,7 @@ The location of the cache directory depends on the operating system and the environment; see :ref:`caching`. Each repository has its own cache sub-directory, consisting of the repository ID -which is chosen at ``init``. All cache directories for different repos are +which is chosen at ``init``. All cache directories for different repositories are independent of each other. Snapshots, Data and Indexes @@ -19,8 +19,8 @@ Snapshot, Data and Index files are cached in the sub-directories ``snapshots``, Expiry ====== -Whenever a cache directory for a repo is used, that directory's modification +Whenever a cache directory for a repository is used, that directory's modification timestamp is updated to the current time. By looking at the modification -timestamps of the repo cache directories it is easy to decide which directories +timestamps of the repository cache directories it is easy to decide which directories are old and haven't been used in a long time. Those are probably stale and can be removed. diff --git a/doc/faq.rst b/doc/faq.rst index bad55708c..6292f2de8 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -51,7 +51,7 @@ looks like this: [0:00] 100.00% 16 / 16 snapshots no errors were found -The message means that there is more data stored in the repo than +The message means that there is more data stored in the repository than strictly necessary. This is uncritical. With high probability this is duplicate data caused by an interrupted backup run or upload operation. In order to clean it up, the command ``restic prune`` can be used. @@ -168,8 +168,8 @@ scheduling algorithm to give it the least favorable niceness (19). The above example makes sure that the system the backup runs on is not slowed down, which is particularly useful for servers. -Creating new repo on a Synology NAS via sftp fails --------------------------------------------------- +Creating new repository on a Synology NAS via sftp fails +-------------------------------------------------------- For using restic with a Synology NAS via sftp, please make sure that the specified path is absolute, it must start with a slash (``/``). diff --git a/doc/manual_rest.rst b/doc/manual_rest.rst index 87f3104a1..fc7f73e51 100644 --- a/doc/manual_rest.rst +++ b/doc/manual_rest.rst @@ -50,7 +50,7 @@ Usage help is available: --cache-dir directory set the cache directory. (default: use system default cache directory) --cleanup-cache auto remove old cache directories -h, --help help for restic - --insecure-tls skip TLS certificate verification when connecting to the repo (insecure) + --insecure-tls skip TLS certificate verification when connecting to the repository (insecure) --json set output mode to JSON for commands that support it --key-hint key key ID of key to try decrypting first (default: $RESTIC_KEY_HINT) --limit-download int limits downloads to a maximum rate in KiB/s. (default: unlimited) @@ -107,7 +107,7 @@ command: --iexclude-file file same as --exclude-file but ignores casing of filenames in patterns --ignore-inode ignore inode number changes when checking for modified files -x, --one-file-system exclude other file systems, don't cross filesystem boundaries and subvolumes - --parent snapshot use this parent snapshot (default: last snapshot in the repo that has the same target files/directories) + --parent snapshot use this parent snapshot (default: last snapshot in the repository that has the same target files/directories) --stdin read backup from stdin --stdin-filename filename filename to use when reading from stdin (default "stdin") --tag tags add tags for the new snapshot in the format `tag[,tag,...]` (can be specified multiple times) (default []) @@ -119,7 +119,7 @@ command: --cacert file file to load root certificates from (default: use system certificates) --cache-dir directory set the cache directory. (default: use system default cache directory) --cleanup-cache auto remove old cache directories - --insecure-tls skip TLS certificate verification when connecting to the repo (insecure) + --insecure-tls skip TLS certificate verification when connecting to the repository (insecure) --json set output mode to JSON for commands that support it --key-hint key key ID of key to try decrypting first (default: $RESTIC_KEY_HINT) --limit-download int limits downloads to a maximum rate in KiB/s. (default: unlimited) @@ -431,7 +431,7 @@ The cache is ephemeral: When a file cannot be read from the cache, it is loaded from the repository. Within the cache directory, there's a sub directory for each repository the -cache was used with. Restic updates the timestamps of a repo directory each +cache was used with. Restic updates the timestamps of a repository directory each time it is used, so by looking at the timestamps of the sub directories of the cache directory it can decide which sub directories are old and probably not needed any more. You can either remove these directories manually, or run a diff --git a/internal/backend/location/location.go b/internal/backend/location/location.go index 43d6fa5a6..daef51d40 100644 --- a/internal/backend/location/location.go +++ b/internal/backend/location/location.go @@ -101,7 +101,7 @@ func Parse(s string) (u Location, err error) { // if s is not a path or contains ":", it's ambiguous if !isPath(s) && strings.ContainsRune(s, ':') { - return Location{}, errors.New("invalid backend\nIf the repo is in a local directory, you need to add a `local:` prefix") + return Location{}, errors.New("invalid backend\nIf the repository is in a local directory, you need to add a `local:` prefix") } u.Scheme = "local" diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 8d3fd9414..84193a4f3 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -725,11 +725,11 @@ func (r *Repository) SearchKey(ctx context.Context, password string, maxKeys int // saves the repository config. func (r *Repository) Init(ctx context.Context, version uint, password string, chunkerPolynomial *chunker.Pol) error { if version > restic.MaxRepoVersion { - return fmt.Errorf("repo version %v too high", version) + return fmt.Errorf("repository version %v too high", version) } if version < restic.MinRepoVersion { - return fmt.Errorf("repo version %v too low", version) + return fmt.Errorf("repository version %v too low", version) } has, err := r.be.Test(ctx, restic.Handle{Type: restic.ConfigFile}) diff --git a/internal/ui/backup/text.go b/internal/ui/backup/text.go index 85408e467..801def0db 100644 --- a/internal/ui/backup/text.go +++ b/internal/ui/backup/text.go @@ -178,7 +178,7 @@ func (b *TextProgress) Finish(snapshotID restic.ID, start time.Time, summary *Su if dryRun { verb = "Would add" } - b.P("%s to the repo: %-5s (%-5s stored)\n", verb, formatBytes(summary.ItemStats.DataSize+summary.ItemStats.TreeSize), formatBytes(summary.ItemStats.DataSizeInRepo+summary.ItemStats.TreeSizeInRepo)) + b.P("%s to the repository: %-5s (%-5s stored)\n", verb, formatBytes(summary.ItemStats.DataSize+summary.ItemStats.TreeSize), formatBytes(summary.ItemStats.DataSizeInRepo+summary.ItemStats.TreeSizeInRepo)) b.P("\n") b.P("processed %v files, %v in %s", summary.Files.New+summary.Files.Changed+summary.Files.Unchanged, From ec4dfa3c662b1803477676d10a32d2e445effd1a Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Tue, 12 Jul 2022 20:48:01 +0200 Subject: [PATCH 2/3] Wording: replace further repo occurrences with repository --- cmd/restic/cmd_prune.go | 2 +- cmd/restic/global.go | 2 +- doc/030_preparing_a_new_repo.rst | 2 +- doc/040_backup.rst | 4 ++-- doc/045_working_with_repos.rst | 2 +- doc/050_restore.rst | 2 +- doc/060_forget.rst | 4 ++-- doc/manual_rest.rst | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/restic/cmd_prune.go b/cmd/restic/cmd_prune.go index ad306858b..115f48557 100644 --- a/cmd/restic/cmd_prune.go +++ b/cmd/restic/cmd_prune.go @@ -641,7 +641,7 @@ func getUsedBlobs(gopts GlobalOptions, repo restic.Repository, ignoreSnapshots r err = restic.FindUsedBlobs(ctx, repo, snapshotTrees, usedBlobs, bar) if err != nil { if repo.Backend().IsNotExist(err) { - return nil, errors.Fatal("unable to load a tree from the repo: " + err.Error()) + return nil, errors.Fatal("unable to load a tree from the repository: " + err.Error()) } return nil, err diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 3d240886d..41f6bfb0e 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -116,7 +116,7 @@ func init() { f.BoolVar(&globalOptions.NoCache, "no-cache", false, "do not use a local cache") f.StringSliceVar(&globalOptions.RootCertFilenames, "cacert", nil, "`file` to load root certificates from (default: use system certificates)") f.StringVar(&globalOptions.TLSClientCertKeyFilename, "tls-client-cert", "", "path to a `file` containing PEM encoded TLS client certificate and private key") - f.BoolVar(&globalOptions.InsecureTLS, "insecure-tls", false, "skip TLS certificate verification when connecting to the repo (insecure)") + f.BoolVar(&globalOptions.InsecureTLS, "insecure-tls", false, "skip TLS certificate verification when connecting to the repository (insecure)") f.BoolVar(&globalOptions.CleanupCache, "cleanup-cache", false, "auto remove old cache directories") f.Var(&globalOptions.Compression, "compression", "compression mode (only available for repository format version 2), one of (auto|off|max)") f.IntVar(&globalOptions.Limits.UploadKb, "limit-upload", 0, "limits uploads to a maximum rate in KiB/s. (default: unlimited)") diff --git a/doc/030_preparing_a_new_repo.rst b/doc/030_preparing_a_new_repo.rst index 13c0347ad..f0da69d28 100644 --- a/doc/030_preparing_a_new_repo.rst +++ b/doc/030_preparing_a_new_repo.rst @@ -583,7 +583,7 @@ store data there. First, you need to install and `configure`_ rclone. The general backend specification format is ``rclone::``, the ``:`` component will be directly passed to rclone. When you configure a remote named ``foo``, you can then call restic as follows to -initiate a new repository in the path ``bar`` in the repo: +initiate a new repository in the path ``bar`` in the remote ``foo``: .. code-block:: console diff --git a/doc/040_backup.rst b/doc/040_backup.rst index dbc65b51d..18af542b0 100644 --- a/doc/040_backup.rst +++ b/doc/040_backup.rst @@ -191,7 +191,7 @@ Dry Runs ******** You can perform a backup in dry run mode to see what would happen without -modifying the repo. +modifying the repository. - ``--dry-run``/``-n`` Report what would be done, without writing to the repository @@ -202,7 +202,7 @@ Combined with ``--verbose``, you can see a list of changes: $ 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 + Would be added to the repository: 25.551 MiB Excluding Files *************** diff --git a/doc/045_working_with_repos.rst b/doc/045_working_with_repos.rst index d34b09c08..1bef0a666 100644 --- a/doc/045_working_with_repos.rst +++ b/doc/045_working_with_repos.rst @@ -309,7 +309,7 @@ Upgrading must be done explicitly as a newer repository version increases the minimum restic version required to access the repository. For example the repository format version 2 is only readable using restic 0.14.0 or newer. -Upgrading to repo version 2 is a two step process: first run +Upgrading to repository version 2 is a two step process: first run ``migrate upgrade_repo_v2`` which will check the repository integrity and then upgrade the repository version. Repository problems must be corrected before the migration will be possible. After the migration is complete, run diff --git a/doc/050_restore.rst b/doc/050_restore.rst index 279397e83..c7f6c0f28 100644 --- a/doc/050_restore.rst +++ b/doc/050_restore.rst @@ -96,7 +96,7 @@ the data directly. This can be achieved by using the `dump` command, like this: If you have saved multiple different things into the same repo, the ``latest`` snapshot may not be the right one. For example, consider the following -snapshots in a repo: +snapshots in a repository: .. code-block:: console diff --git a/doc/060_forget.rst b/doc/060_forget.rst index 36de1b2cc..a4205de75 100644 --- a/doc/060_forget.rst +++ b/doc/060_forget.rst @@ -418,8 +418,8 @@ The ``prune`` command accepts the following options: * As an absolute size (e.g. ``200M``). If you want to minimize the space used by your repository, pass ``0`` to this option. - * As a size relative to the total repo size (e.g. ``10%``). This means that - after prune, at most ``10%`` of the total data stored in the repo may be + * As a size relative to the total repository size (e.g. ``10%``). This means that + after prune, at most ``10%`` of the total data stored in the repository may be unused data. If the repository after prune has a size of 500MB, then at most 50MB may be unused. * If the string ``unlimited`` is passed, there is no limit for partly diff --git a/doc/manual_rest.rst b/doc/manual_rest.rst index fc7f73e51..9ba22a546 100644 --- a/doc/manual_rest.rst +++ b/doc/manual_rest.rst @@ -425,7 +425,7 @@ message. The command line parameter ``--cache-dir`` or the environment variable ``$RESTIC_CACHE_DIR`` can be used to override the default cache location. The parameter ``--no-cache`` disables the cache entirely. In this case, all data -is loaded from the repo. +is loaded from the repository. The cache is ephemeral: When a file cannot be read from the cache, it is loaded from the repository. From 2aad6f24b572540d9039f71bccf5fcbeb466aca6 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Tue, 12 Jul 2022 20:49:01 +0200 Subject: [PATCH 3/3] doc: update sample help output --- doc/manual_rest.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/manual_rest.rst b/doc/manual_rest.rst index 9ba22a546..040c091fa 100644 --- a/doc/manual_rest.rst +++ b/doc/manual_rest.rst @@ -36,7 +36,7 @@ Usage help is available: mount Mount the repository prune Remove unneeded data from the repository rebuild-index Build a new index - recover Recover data from the repository + recover Recover data from the repository not referenced by snapshots restore Extract the data from a snapshot self-update Update the restic binary snapshots List all snapshots @@ -49,6 +49,7 @@ Usage help is available: --cacert file file to load root certificates from (default: use system certificates) --cache-dir directory set the cache directory. (default: use system default cache directory) --cleanup-cache auto remove old cache directories + --compression mode compression mode (only available for repository format version 2), one of (auto|off|max) (default auto) -h, --help help for restic --insecure-tls skip TLS certificate verification when connecting to the repository (insecure) --json set output mode to JSON for commands that support it @@ -92,6 +93,7 @@ command: restic backup [flags] FILE/DIR [FILE/DIR] ... Flags: + -n, --dry-run do not upload or write any data, just show what would be done -e, --exclude pattern exclude a pattern (can be specified multiple times) --exclude-caches excludes cache directories that are marked with a CACHEDIR.TAG file. See https://bford.info/cachedir/ for the Cache Directory Tagging Standard --exclude-file file read exclude patterns from a file (can be specified multiple times) @@ -105,9 +107,10 @@ command: -H, --host hostname set the hostname for the snapshot manually. To prevent an expensive rescan use the "parent" flag --iexclude pattern same as --exclude pattern but ignores the casing of filenames --iexclude-file file same as --exclude-file but ignores casing of filenames in patterns + --ignore-ctime ignore ctime changes when checking for modified files --ignore-inode ignore inode number changes when checking for modified files -x, --one-file-system exclude other file systems, don't cross filesystem boundaries and subvolumes - --parent snapshot use this parent snapshot (default: last snapshot in the repository that has the same target files/directories) + --parent snapshot use this parent snapshot (default: last snapshot in the repository that has the same target files/directories, and is not newer than the snapshot time) --stdin read backup from stdin --stdin-filename filename filename to use when reading from stdin (default "stdin") --tag tags add tags for the new snapshot in the format `tag[,tag,...]` (can be specified multiple times) (default []) @@ -119,6 +122,7 @@ command: --cacert file file to load root certificates from (default: use system certificates) --cache-dir directory set the cache directory. (default: use system default cache directory) --cleanup-cache auto remove old cache directories + --compression mode compression mode (only available for repository format version 2), one of (auto|off|max) (default auto) --insecure-tls skip TLS certificate verification when connecting to the repository (insecure) --json set output mode to JSON for commands that support it --key-hint key key ID of key to try decrypting first (default: $RESTIC_KEY_HINT)