From da196aa43e9d99b091f8771b5bb4e7304e0b8441 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 12 Jan 2023 20:51:19 +0100 Subject: [PATCH] Update manpages and auto-completion --- doc/bash-completion.sh | 113 ++++++++++++++++ doc/man/restic-backup.1 | 16 ++- doc/man/restic-cache.1 | 8 +- doc/man/restic-cat.1 | 8 +- doc/man/restic-check.1 | 8 +- doc/man/restic-copy.1 | 14 +- doc/man/restic-diff.1 | 8 +- doc/man/restic-dump.1 | 14 +- doc/man/restic-find.1 | 14 +- doc/man/restic-forget.1 | 14 +- doc/man/restic-generate.1 | 14 +- doc/man/restic-init.1 | 8 +- doc/man/restic-key.1 | 8 +- doc/man/restic-list.1 | 8 +- doc/man/restic-ls.1 | 12 +- doc/man/restic-migrate.1 | 8 +- doc/man/restic-mount.1 | 14 +- doc/man/restic-prune.1 | 8 +- doc/man/restic-rebuild-index.1 | 8 +- doc/man/restic-recover.1 | 8 +- doc/man/restic-restore.1 | 18 ++- doc/man/restic-rewrite.1 | 167 ++++++++++++++++++++++++ doc/man/restic-self-update.1 | 8 +- doc/man/restic-snapshots.1 | 12 +- doc/man/restic-stats.1 | 14 +- doc/man/restic-tag.1 | 14 +- doc/man/restic-unlock.1 | 8 +- doc/man/restic-version.1 | 8 +- doc/man/restic.1 | 10 +- doc/powershell-completion.ps1 | 230 +++++++++++++++++++++++++++++++++ 30 files changed, 664 insertions(+), 138 deletions(-) create mode 100644 doc/man/restic-rewrite.1 create mode 100644 doc/powershell-completion.ps1 diff --git a/doc/bash-completion.sh b/doc/bash-completion.sh index f76ae5a7c..42f459f65 100644 --- a/doc/bash-completion.sh +++ b/doc/bash-completion.sh @@ -436,6 +436,8 @@ _restic_backup() local_nonpersistent_flags+=("--ignore-ctime") flags+=("--ignore-inode") local_nonpersistent_flags+=("--ignore-inode") + flags+=("--no-scan") + local_nonpersistent_flags+=("--no-scan") flags+=("--one-file-system") flags+=("-x") local_nonpersistent_flags+=("--one-file-system") @@ -444,6 +446,10 @@ _restic_backup() two_word_flags+=("--parent") local_nonpersistent_flags+=("--parent") local_nonpersistent_flags+=("--parent=") + flags+=("--read-concurrency=") + two_word_flags+=("--read-concurrency") + local_nonpersistent_flags+=("--read-concurrency") + local_nonpersistent_flags+=("--read-concurrency=") flags+=("--stdin") local_nonpersistent_flags+=("--stdin") flags+=("--stdin-filename=") @@ -1256,6 +1262,10 @@ _restic_generate() two_word_flags+=("--man") local_nonpersistent_flags+=("--man") local_nonpersistent_flags+=("--man=") + flags+=("--powershell-completion=") + two_word_flags+=("--powershell-completion") + local_nonpersistent_flags+=("--powershell-completion") + local_nonpersistent_flags+=("--powershell-completion=") flags+=("--zsh-completion=") two_word_flags+=("--zsh-completion") local_nonpersistent_flags+=("--zsh-completion") @@ -2083,6 +2093,8 @@ _restic_restore() two_word_flags+=("--path") local_nonpersistent_flags+=("--path") local_nonpersistent_flags+=("--path=") + flags+=("--sparse") + local_nonpersistent_flags+=("--sparse") flags+=("--tag=") two_word_flags+=("--tag") local_nonpersistent_flags+=("--tag") @@ -2139,6 +2151,106 @@ _restic_restore() noun_aliases=() } +_restic_rewrite() +{ + last_command="restic_rewrite" + + command_aliases=() + + commands=() + + flags=() + two_word_flags=() + local_nonpersistent_flags=() + flags_with_completion=() + flags_completion=() + + flags+=("--dry-run") + flags+=("-n") + local_nonpersistent_flags+=("--dry-run") + local_nonpersistent_flags+=("-n") + flags+=("--exclude=") + two_word_flags+=("--exclude") + two_word_flags+=("-e") + local_nonpersistent_flags+=("--exclude") + local_nonpersistent_flags+=("--exclude=") + local_nonpersistent_flags+=("-e") + flags+=("--exclude-file=") + two_word_flags+=("--exclude-file") + local_nonpersistent_flags+=("--exclude-file") + local_nonpersistent_flags+=("--exclude-file=") + flags+=("--forget") + local_nonpersistent_flags+=("--forget") + flags+=("--help") + flags+=("-h") + local_nonpersistent_flags+=("--help") + local_nonpersistent_flags+=("-h") + flags+=("--host=") + two_word_flags+=("--host") + two_word_flags+=("-H") + local_nonpersistent_flags+=("--host") + local_nonpersistent_flags+=("--host=") + local_nonpersistent_flags+=("-H") + flags+=("--iexclude=") + two_word_flags+=("--iexclude") + local_nonpersistent_flags+=("--iexclude") + local_nonpersistent_flags+=("--iexclude=") + flags+=("--iexclude-file=") + two_word_flags+=("--iexclude-file") + local_nonpersistent_flags+=("--iexclude-file") + local_nonpersistent_flags+=("--iexclude-file=") + flags+=("--path=") + two_word_flags+=("--path") + local_nonpersistent_flags+=("--path") + local_nonpersistent_flags+=("--path=") + flags+=("--tag=") + two_word_flags+=("--tag") + local_nonpersistent_flags+=("--tag") + local_nonpersistent_flags+=("--tag=") + flags+=("--cacert=") + two_word_flags+=("--cacert") + flags+=("--cache-dir=") + two_word_flags+=("--cache-dir") + flags+=("--cleanup-cache") + flags+=("--compression=") + two_word_flags+=("--compression") + flags+=("--insecure-tls") + flags+=("--json") + flags+=("--key-hint=") + two_word_flags+=("--key-hint") + flags+=("--limit-download=") + two_word_flags+=("--limit-download") + flags+=("--limit-upload=") + two_word_flags+=("--limit-upload") + flags+=("--no-cache") + flags+=("--no-lock") + flags+=("--option=") + two_word_flags+=("--option") + two_word_flags+=("-o") + flags+=("--pack-size=") + two_word_flags+=("--pack-size") + flags+=("--password-command=") + two_word_flags+=("--password-command") + flags+=("--password-file=") + two_word_flags+=("--password-file") + two_word_flags+=("-p") + flags+=("--quiet") + flags+=("-q") + flags+=("--repo=") + two_word_flags+=("--repo") + two_word_flags+=("-r") + flags+=("--repository-file=") + two_word_flags+=("--repository-file") + flags+=("--tls-client-cert=") + two_word_flags+=("--tls-client-cert") + flags+=("--verbose") + flags+=("-v") + + must_have_one_flag=() + must_have_one_noun=() + noun_aliases=() +} + _restic_self-update() { last_command="restic_self-update" @@ -2617,6 +2729,7 @@ _restic_root_command() commands+=("rebuild-index") commands+=("recover") commands+=("restore") + commands+=("rewrite") commands+=("self-update") commands+=("snapshots") commands+=("stats") diff --git a/doc/man/restic-backup.1 b/doc/man/restic-backup.1 index 8a7bfc1ce..2598678d0 100644 --- a/doc/man/restic-backup.1 +++ b/doc/man/restic-backup.1 @@ -89,6 +89,10 @@ Exit status is 3 if some source data could not be read (incomplete snapshot crea \fB--ignore-inode\fP[=false] ignore inode number changes when checking for modified files +.PP +\fB--no-scan\fP[=false] + do not run scanner to estimate size of backup + .PP \fB-x\fP, \fB--one-file-system\fP[=false] exclude other file systems, don't cross filesystem boundaries and subvolumes @@ -97,6 +101,10 @@ Exit status is 3 if some source data could not be read (incomplete snapshot crea \fB--parent\fP="" use this parent \fB\fCsnapshot\fR (default: last snapshot in the repository that has the same target files/directories, and is not newer than the snapshot time) +.PP +\fB--read-concurrency\fP=0 + read \fB\fCn\fR files concurrently (default: $RESTIC_READ_CONCURRENCY or 2) + .PP \fB--stdin\fP[=false] read backup from stdin @@ -149,11 +157,11 @@ Exit status is 3 if some source data could not be read (incomplete snapshot crea .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -169,7 +177,7 @@ Exit status is 3 if some source data could not be read (incomplete snapshot crea .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -197,7 +205,7 @@ Exit status is 3 if some source data could not be read (incomplete snapshot crea .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-cache.1 b/doc/man/restic-cache.1 index bedf699a8..302bcb01e 100644 --- a/doc/man/restic-cache.1 +++ b/doc/man/restic-cache.1 @@ -70,11 +70,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -90,7 +90,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -118,7 +118,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-cat.1 b/doc/man/restic-cat.1 index 4fcc373c3..1fb7dd45f 100644 --- a/doc/man/restic-cat.1 +++ b/doc/man/restic-cat.1 @@ -58,11 +58,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -78,7 +78,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -106,7 +106,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-check.1 b/doc/man/restic-check.1 index fd617b524..e08b83d46 100644 --- a/doc/man/restic-check.1 +++ b/doc/man/restic-check.1 @@ -75,11 +75,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -95,7 +95,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -123,7 +123,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-copy.1 b/doc/man/restic-copy.1 index d87f05d6e..07dcfe957 100644 --- a/doc/man/restic-copy.1 +++ b/doc/man/restic-copy.1 @@ -57,15 +57,15 @@ new destination repository using the "init" command. .PP \fB-H\fP, \fB--host\fP=[] - only consider snapshots for this \fB\fChost\fR, when no snapshot ID is given (can be specified multiple times) + only consider snapshots for this \fB\fChost\fR (can be specified multiple times) .PP \fB--path\fP=[] - only consider snapshots which include this (absolute) \fB\fCpath\fR, when no snapshot ID is given + only consider snapshots including this (absolute) \fB\fCpath\fR (can be specified multiple times) .PP \fB--tag\fP=[] - only consider snapshots which include this \fB\fCtaglist\fR, when no snapshot ID is given + only consider snapshots including \fB\fCtag[,tag,...]\fR (can be specified multiple times) .SH OPTIONS INHERITED FROM PARENT COMMANDS @@ -99,11 +99,11 @@ new destination repository using the "init" command. .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -119,7 +119,7 @@ new destination repository using the "init" command. .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -147,7 +147,7 @@ new destination repository using the "init" command. .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-diff.1 b/doc/man/restic-diff.1 index bb1f8af97..f0707a257 100644 --- a/doc/man/restic-diff.1 +++ b/doc/man/restic-diff.1 @@ -78,11 +78,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -98,7 +98,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -126,7 +126,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-dump.1 b/doc/man/restic-dump.1 index f0475cbe3..f9a2368bc 100644 --- a/doc/man/restic-dump.1 +++ b/doc/man/restic-dump.1 @@ -39,15 +39,15 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-H\fP, \fB--host\fP=[] - only consider snapshots for this host when the snapshot ID is "latest" (can be specified multiple times) + only consider snapshots for this \fB\fChost\fR, when snapshot ID "latest" is given (can be specified multiple times) .PP \fB--path\fP=[] - only consider snapshots which include this (absolute) \fB\fCpath\fR for snapshot ID "latest" + only consider snapshots including this (absolute) \fB\fCpath\fR, when snapshot ID "latest" is given (can be specified multiple times) .PP \fB--tag\fP=[] - only consider snapshots which include this \fB\fCtaglist\fR for snapshot ID "latest" + only consider snapshots including \fB\fCtag[,tag,...]\fR, when snapshot ID "latest" is given (can be specified multiple times) .SH OPTIONS INHERITED FROM PARENT COMMANDS @@ -81,11 +81,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -101,7 +101,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -129,7 +129,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-find.1 b/doc/man/restic-find.1 index 51185f53b..4f5bdd4e3 100644 --- a/doc/man/restic-find.1 +++ b/doc/man/restic-find.1 @@ -29,7 +29,7 @@ It can also be used to search for restic blobs or trees for troubleshooting. .PP \fB-H\fP, \fB--host\fP=[] - only consider snapshots for this \fB\fChost\fR, when no snapshot ID is given (can be specified multiple times) + only consider snapshots for this \fB\fChost\fR (can be specified multiple times) .PP \fB-i\fP, \fB--ignore-case\fP[=false] @@ -53,7 +53,7 @@ It can also be used to search for restic blobs or trees for troubleshooting. .PP \fB--path\fP=[] - only consider snapshots which include this (absolute) \fB\fCpath\fR, when no snapshot-ID is given + only consider snapshots including this (absolute) \fB\fCpath\fR (can be specified multiple times) .PP \fB--show-pack-id\fP[=false] @@ -65,7 +65,7 @@ It can also be used to search for restic blobs or trees for troubleshooting. .PP \fB--tag\fP=[] - only consider snapshots which include this \fB\fCtaglist\fR, when no snapshot-ID is given + only consider snapshots including \fB\fCtag[,tag,...]\fR (can be specified multiple times) .PP \fB--tree\fP[=false] @@ -103,11 +103,11 @@ It can also be used to search for restic blobs or trees for troubleshooting. .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -123,7 +123,7 @@ It can also be used to search for restic blobs or trees for troubleshooting. .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -151,7 +151,7 @@ It can also be used to search for restic blobs or trees for troubleshooting. .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH EXAMPLE diff --git a/doc/man/restic-forget.1 b/doc/man/restic-forget.1 index 0be653216..f46d05736 100644 --- a/doc/man/restic-forget.1 +++ b/doc/man/restic-forget.1 @@ -87,15 +87,15 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--host\fP=[] - only consider snapshots with the given \fB\fChost\fR (can be specified multiple times) + only consider snapshots for this \fB\fChost\fR (can be specified multiple times) .PP \fB--tag\fP=[] - only consider snapshots which include this \fB\fCtaglist\fR in the format \fB\fCtag[,tag,...]\fR (can be specified multiple times) + only consider snapshots including \fB\fCtag[,tag,...]\fR (can be specified multiple times) .PP \fB--path\fP=[] - only consider snapshots which include this (absolute) \fB\fCpath\fR (can be specified multiple times) + only consider snapshots including this (absolute) \fB\fCpath\fR (can be specified multiple times) .PP \fB-c\fP, \fB--compact\fP[=false] @@ -169,11 +169,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -189,7 +189,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -217,7 +217,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-generate.1 b/doc/man/restic-generate.1 index 6bda99f7c..e3733ce60 100644 --- a/doc/man/restic-generate.1 +++ b/doc/man/restic-generate.1 @@ -3,7 +3,7 @@ .SH NAME .PP -restic-generate - Generate manual pages and auto-completion files (bash, fish, zsh) +restic-generate - Generate manual pages and auto-completion files (bash, fish, zsh, powershell) .SH SYNOPSIS @@ -39,6 +39,10 @@ Exit status is 0 if the command was successful, and non-zero if there was any er \fB--man\fP="" write man pages to \fB\fCdirectory\fR +.PP +\fB--powershell-completion\fP="" + write powershell completion \fB\fCfile\fR + .PP \fB--zsh-completion\fP="" write zsh completion \fB\fCfile\fR @@ -75,11 +79,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -95,7 +99,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -123,7 +127,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-init.1 b/doc/man/restic-init.1 index 87ba79a36..80edf5362 100644 --- a/doc/man/restic-init.1 +++ b/doc/man/restic-init.1 @@ -86,11 +86,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -106,7 +106,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -134,7 +134,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-key.1 b/doc/man/restic-key.1 index 4afa3d116..ff6ab4fd0 100644 --- a/doc/man/restic-key.1 +++ b/doc/man/restic-key.1 @@ -70,11 +70,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -90,7 +90,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -118,7 +118,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-list.1 b/doc/man/restic-list.1 index c87f1d0a6..e2f878c76 100644 --- a/doc/man/restic-list.1 +++ b/doc/man/restic-list.1 @@ -58,11 +58,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -78,7 +78,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -106,7 +106,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-ls.1 b/doc/man/restic-ls.1 index 9d77ee62d..afd72ff71 100644 --- a/doc/man/restic-ls.1 +++ b/doc/man/restic-ls.1 @@ -51,7 +51,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--path\fP=[] - only consider snapshots which include this (absolute) \fB\fCpath\fR, when snapshot ID "latest" is given (can be specified multiple times) + only consider snapshots including this (absolute) \fB\fCpath\fR, when snapshot ID "latest" is given (can be specified multiple times) .PP \fB--recursive\fP[=false] @@ -59,7 +59,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--tag\fP=[] - only consider snapshots which include this \fB\fCtaglist\fR, when snapshot ID "latest" is given (can be specified multiple times) + only consider snapshots including \fB\fCtag[,tag,...]\fR, when snapshot ID "latest" is given (can be specified multiple times) .SH OPTIONS INHERITED FROM PARENT COMMANDS @@ -93,11 +93,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -113,7 +113,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -141,7 +141,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-migrate.1 b/doc/man/restic-migrate.1 index 578c85d69..ee4d44e71 100644 --- a/doc/man/restic-migrate.1 +++ b/doc/man/restic-migrate.1 @@ -64,11 +64,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -84,7 +84,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -112,7 +112,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-mount.1 b/doc/man/restic-mount.1 index b2feee01c..da38ae451 100644 --- a/doc/man/restic-mount.1 +++ b/doc/man/restic-mount.1 @@ -84,7 +84,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-H\fP, \fB--host\fP=[] - only consider snapshots for this host (can be specified multiple times) + only consider snapshots for this \fB\fChost\fR (can be specified multiple times) .PP \fB--no-default-permissions\fP[=false] @@ -96,7 +96,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--path\fP=[] - only consider snapshots which include this (absolute) \fB\fCpath\fR + only consider snapshots including this (absolute) \fB\fCpath\fR (can be specified multiple times) .PP \fB--path-template\fP=[] @@ -104,7 +104,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--tag\fP=[] - only consider snapshots which include this \fB\fCtaglist\fR + only consider snapshots including \fB\fCtag[,tag,...]\fR (can be specified multiple times) .PP \fB--time-template\fP="2006-01-02T15:04:05Z07:00" @@ -142,11 +142,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -162,7 +162,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -190,7 +190,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-prune.1 b/doc/man/restic-prune.1 index 77a712039..88c03f72a 100644 --- a/doc/man/restic-prune.1 +++ b/doc/man/restic-prune.1 @@ -87,11 +87,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -107,7 +107,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -135,7 +135,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-rebuild-index.1 b/doc/man/restic-rebuild-index.1 index c37f55a18..3be67e79e 100644 --- a/doc/man/restic-rebuild-index.1 +++ b/doc/man/restic-rebuild-index.1 @@ -63,11 +63,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -83,7 +83,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -111,7 +111,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-recover.1 b/doc/man/restic-recover.1 index cc45eec9a..7415a1113 100644 --- a/doc/man/restic-recover.1 +++ b/doc/man/restic-recover.1 @@ -60,11 +60,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -80,7 +80,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -108,7 +108,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-restore.1 b/doc/man/restic-restore.1 index e96337e7d..2348f7478 100644 --- a/doc/man/restic-restore.1 +++ b/doc/man/restic-restore.1 @@ -37,7 +37,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-H\fP, \fB--host\fP=[] - only consider snapshots for this host when the snapshot ID is "latest" (can be specified multiple times) + only consider snapshots for this \fB\fChost\fR, when snapshot ID "latest" is given (can be specified multiple times) .PP \fB--iexclude\fP=[] @@ -53,11 +53,15 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--path\fP=[] - only consider snapshots which include this (absolute) \fB\fCpath\fR for snapshot ID "latest" + only consider snapshots including this (absolute) \fB\fCpath\fR, when snapshot ID "latest" is given (can be specified multiple times) + +.PP +\fB--sparse\fP[=false] + restore files as sparse .PP \fB--tag\fP=[] - only consider snapshots which include this \fB\fCtaglist\fR for snapshot ID "latest" + only consider snapshots including \fB\fCtag[,tag,...]\fR, when snapshot ID "latest" is given (can be specified multiple times) .PP \fB-t\fP, \fB--target\fP="" @@ -99,11 +103,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -119,7 +123,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -147,7 +151,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-rewrite.1 b/doc/man/restic-rewrite.1 new file mode 100644 index 000000000..9f33bcb64 --- /dev/null +++ b/doc/man/restic-rewrite.1 @@ -0,0 +1,167 @@ +.nh +.TH "restic backup" "1" "Jan 2017" "generated by \fB\fCrestic generate\fR" "" + +.SH NAME +.PP +restic-rewrite - Rewrite snapshots to exclude unwanted files + + +.SH SYNOPSIS +.PP +\fBrestic rewrite [flags] [snapshotID ...]\fP + + +.SH DESCRIPTION +.PP +The "rewrite" command excludes files from existing snapshots. It creates new +snapshots containing the same data as the original ones, but without the files +you specify to exclude. All metadata (time, host, tags) will be preserved. + +.PP +The snapshots to rewrite are specified using the --host, --tag and --path options, +or by providing a list of snapshot IDs. Please note that specifying neither any of +these options nor a snapshot ID will cause the command to rewrite all snapshots. + +.PP +The special tag 'rewrite' will be added to the new snapshots to distinguish +them from the original ones, unless --forget is used. If the --forget option is +used, the original snapshots will instead be directly removed from the repository. + +.PP +Please note that the --forget option only removes the snapshots and not the actual +data stored in the repository. In order to delete the no longer referenced data, +use the "prune" command. + + +.SH EXIT STATUS +.PP +Exit status is 0 if the command was successful, and non-zero if there was any error. + + +.SH OPTIONS +.PP +\fB-n\fP, \fB--dry-run\fP[=false] + do not do anything, just print what would be done + +.PP +\fB-e\fP, \fB--exclude\fP=[] + exclude a \fB\fCpattern\fR (can be specified multiple times) + +.PP +\fB--exclude-file\fP=[] + read exclude patterns from a \fB\fCfile\fR (can be specified multiple times) + +.PP +\fB--forget\fP[=false] + remove original snapshots after creating new ones + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for rewrite + +.PP +\fB-H\fP, \fB--host\fP=[] + only consider snapshots for this \fB\fChost\fR (can be specified multiple times) + +.PP +\fB--iexclude\fP=[] + same as --exclude \fB\fCpattern\fR but ignores the casing of filenames + +.PP +\fB--iexclude-file\fP=[] + same as --exclude-file but ignores casing of \fB\fCfile\fRnames in patterns + +.PP +\fB--path\fP=[] + only consider snapshots including this (absolute) \fB\fCpath\fR (can be specified multiple times) + +.PP +\fB--tag\fP=[] + only consider snapshots including \fB\fCtag[,tag,...]\fR (can be specified multiple times) + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--cacert\fP=[] + \fB\fCfile\fR to load root certificates from (default: use system certificates) + +.PP +\fB--cache-dir\fP="" + set the cache \fB\fCdirectory\fR\&. (default: use system default cache directory) + +.PP +\fB--cleanup-cache\fP[=false] + auto remove old cache directories + +.PP +\fB--compression\fP=auto + compression mode (only available for repository format version 2), one of (auto|off|max) + +.PP +\fB--insecure-tls\fP[=false] + skip TLS certificate verification when connecting to the repository (insecure) + +.PP +\fB--json\fP[=false] + set output mode to JSON for commands that support it + +.PP +\fB--key-hint\fP="" + \fB\fCkey\fR ID of key to try decrypting first (default: $RESTIC_KEY_HINT) + +.PP +\fB--limit-download\fP=0 + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) + +.PP +\fB--limit-upload\fP=0 + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) + +.PP +\fB--no-cache\fP[=false] + do not use a local cache + +.PP +\fB--no-lock\fP[=false] + do not lock the repository, this allows some operations on read-only repositories + +.PP +\fB-o\fP, \fB--option\fP=[] + set extended option (\fB\fCkey=value\fR, can be specified multiple times) + +.PP +\fB--pack-size\fP=0 + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + +.PP +\fB--password-command\fP="" + shell \fB\fCcommand\fR to obtain the repository password from (default: $RESTIC_PASSWORD_COMMAND) + +.PP +\fB-p\fP, \fB--password-file\fP="" + \fB\fCfile\fR to read the repository password from (default: $RESTIC_PASSWORD_FILE) + +.PP +\fB-q\fP, \fB--quiet\fP[=false] + do not output comprehensive progress report + +.PP +\fB-r\fP, \fB--repo\fP="" + \fB\fCrepository\fR to backup to or restore from (default: $RESTIC_REPOSITORY) + +.PP +\fB--repository-file\fP="" + \fB\fCfile\fR to read the repository location from (default: $RESTIC_REPOSITORY_FILE) + +.PP +\fB--tls-client-cert\fP="" + path to a \fB\fCfile\fR containing PEM encoded TLS client certificate and private key + +.PP +\fB-v\fP, \fB--verbose\fP[=0] + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) + + +.SH SEE ALSO +.PP +\fBrestic(1)\fP diff --git a/doc/man/restic-self-update.1 b/doc/man/restic-self-update.1 index 9ac97d8c7..25f863396 100644 --- a/doc/man/restic-self-update.1 +++ b/doc/man/restic-self-update.1 @@ -65,11 +65,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -85,7 +85,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -113,7 +113,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-snapshots.1 b/doc/man/restic-snapshots.1 index b99ec93d0..78cd664e3 100644 --- a/doc/man/restic-snapshots.1 +++ b/doc/man/restic-snapshots.1 @@ -44,11 +44,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--path\fP=[] - only consider snapshots for this \fB\fCpath\fR (can be specified multiple times) + only consider snapshots including this (absolute) \fB\fCpath\fR (can be specified multiple times) .PP \fB--tag\fP=[] - only consider snapshots which include this \fB\fCtaglist\fR in the format \fB\fCtag[,tag,...]\fR (can be specified multiple times) + only consider snapshots including \fB\fCtag[,tag,...]\fR (can be specified multiple times) .SH OPTIONS INHERITED FROM PARENT COMMANDS @@ -82,11 +82,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -102,7 +102,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -130,7 +130,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-stats.1 b/doc/man/restic-stats.1 index 08d058beb..6e3b9838b 100644 --- a/doc/man/restic-stats.1 +++ b/doc/man/restic-stats.1 @@ -58,7 +58,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-H\fP, \fB--host\fP=[] - only consider snapshots with the given \fB\fChost\fR (can be specified multiple times) + only consider snapshots for this \fB\fChost\fR (can be specified multiple times) .PP \fB--mode\fP="restore-size" @@ -66,11 +66,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--path\fP=[] - only consider snapshots which include this (absolute) \fB\fCpath\fR (can be specified multiple times) + only consider snapshots including this (absolute) \fB\fCpath\fR (can be specified multiple times) .PP \fB--tag\fP=[] - only consider snapshots which include this \fB\fCtaglist\fR in the format \fB\fCtag[,tag,...]\fR (can be specified multiple times) + only consider snapshots including \fB\fCtag[,tag,...]\fR (can be specified multiple times) .SH OPTIONS INHERITED FROM PARENT COMMANDS @@ -104,11 +104,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -124,7 +124,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -152,7 +152,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-tag.1 b/doc/man/restic-tag.1 index bb72612f1..06bf25495 100644 --- a/doc/man/restic-tag.1 +++ b/doc/man/restic-tag.1 @@ -39,11 +39,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-H\fP, \fB--host\fP=[] - only consider snapshots for this \fB\fChost\fR, when no snapshot ID is given (can be specified multiple times) + only consider snapshots for this \fB\fChost\fR (can be specified multiple times) .PP \fB--path\fP=[] - only consider snapshots which include this (absolute) \fB\fCpath\fR, when no snapshot-ID is given + only consider snapshots including this (absolute) \fB\fCpath\fR (can be specified multiple times) .PP \fB--remove\fP=[] @@ -55,7 +55,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--tag\fP=[] - only consider snapshots which include this \fB\fCtaglist\fR, when no snapshot-ID is given + only consider snapshots including \fB\fCtag[,tag,...]\fR (can be specified multiple times) .SH OPTIONS INHERITED FROM PARENT COMMANDS @@ -89,11 +89,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -109,7 +109,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -137,7 +137,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-unlock.1 b/doc/man/restic-unlock.1 index 99a969498..c4ad7f050 100644 --- a/doc/man/restic-unlock.1 +++ b/doc/man/restic-unlock.1 @@ -62,11 +62,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -82,7 +82,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -110,7 +110,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic-version.1 b/doc/man/restic-version.1 index a803cd491..b410d1231 100644 --- a/doc/man/restic-version.1 +++ b/doc/man/restic-version.1 @@ -59,11 +59,11 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -79,7 +79,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -107,7 +107,7 @@ Exit status is 0 if the command was successful, and non-zero if there was any er .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO diff --git a/doc/man/restic.1 b/doc/man/restic.1 index 9577e012a..76602d02d 100644 --- a/doc/man/restic.1 +++ b/doc/man/restic.1 @@ -52,11 +52,11 @@ directories in an encrypted repository stored on different backends. .PP \fB--limit-download\fP=0 - limits downloads to a maximum rate in KiB/s. (default: unlimited) + limits downloads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--limit-upload\fP=0 - limits uploads to a maximum rate in KiB/s. (default: unlimited) + limits uploads to a maximum \fB\fCrate\fR in KiB/s. (default: unlimited) .PP \fB--no-cache\fP[=false] @@ -72,7 +72,7 @@ directories in an encrypted repository stored on different backends. .PP \fB--pack-size\fP=0 - set target pack size in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) + set target pack \fB\fCsize\fR in MiB, created pack files may be larger (default: $RESTIC_PACK_SIZE) .PP \fB--password-command\fP="" @@ -100,9 +100,9 @@ directories in an encrypted repository stored on different backends. .PP \fB-v\fP, \fB--verbose\fP[=0] - be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 3) + be verbose (specify multiple times or a level using --verbose=\fB\fCn\fR, max level/times is 2) .SH SEE ALSO .PP -\fBrestic-backup(1)\fP, \fBrestic-cache(1)\fP, \fBrestic-cat(1)\fP, \fBrestic-check(1)\fP, \fBrestic-copy(1)\fP, \fBrestic-diff(1)\fP, \fBrestic-dump(1)\fP, \fBrestic-find(1)\fP, \fBrestic-forget(1)\fP, \fBrestic-generate(1)\fP, \fBrestic-init(1)\fP, \fBrestic-key(1)\fP, \fBrestic-list(1)\fP, \fBrestic-ls(1)\fP, \fBrestic-migrate(1)\fP, \fBrestic-mount(1)\fP, \fBrestic-prune(1)\fP, \fBrestic-rebuild-index(1)\fP, \fBrestic-recover(1)\fP, \fBrestic-restore(1)\fP, \fBrestic-self-update(1)\fP, \fBrestic-snapshots(1)\fP, \fBrestic-stats(1)\fP, \fBrestic-tag(1)\fP, \fBrestic-unlock(1)\fP, \fBrestic-version(1)\fP +\fBrestic-backup(1)\fP, \fBrestic-cache(1)\fP, \fBrestic-cat(1)\fP, \fBrestic-check(1)\fP, \fBrestic-copy(1)\fP, \fBrestic-diff(1)\fP, \fBrestic-dump(1)\fP, \fBrestic-find(1)\fP, \fBrestic-forget(1)\fP, \fBrestic-generate(1)\fP, \fBrestic-init(1)\fP, \fBrestic-key(1)\fP, \fBrestic-list(1)\fP, \fBrestic-ls(1)\fP, \fBrestic-migrate(1)\fP, \fBrestic-mount(1)\fP, \fBrestic-prune(1)\fP, \fBrestic-rebuild-index(1)\fP, \fBrestic-recover(1)\fP, \fBrestic-restore(1)\fP, \fBrestic-rewrite(1)\fP, \fBrestic-self-update(1)\fP, \fBrestic-snapshots(1)\fP, \fBrestic-stats(1)\fP, \fBrestic-tag(1)\fP, \fBrestic-unlock(1)\fP, \fBrestic-version(1)\fP diff --git a/doc/powershell-completion.ps1 b/doc/powershell-completion.ps1 new file mode 100644 index 000000000..271809161 --- /dev/null +++ b/doc/powershell-completion.ps1 @@ -0,0 +1,230 @@ +# powershell completion for restic -*- shell-script -*- + +function __restic_debug { + if ($env:BASH_COMP_DEBUG_FILE) { + "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE" + } +} + +filter __restic_escapeStringWithSpecialChars { + $_ -replace '\s|#|@|\$|;|,|''|\{|\}|\(|\)|"|`|\||<|>|&','`$&' +} + +[scriptblock]$__resticCompleterBlock = { + param( + $WordToComplete, + $CommandAst, + $CursorPosition + ) + + # Get the current command line and convert into a string + $Command = $CommandAst.CommandElements + $Command = "$Command" + + __restic_debug "" + __restic_debug "========= starting completion logic ==========" + __restic_debug "WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition" + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CursorPosition location, so we need + # to truncate the command-line ($Command) up to the $CursorPosition location. + # Make sure the $Command is longer then the $CursorPosition before we truncate. + # This happens because the $Command does not include the last space. + if ($Command.Length -gt $CursorPosition) { + $Command=$Command.Substring(0,$CursorPosition) + } + __restic_debug "Truncated command: $Command" + + $ShellCompDirectiveError=1 + $ShellCompDirectiveNoSpace=2 + $ShellCompDirectiveNoFileComp=4 + $ShellCompDirectiveFilterFileExt=8 + $ShellCompDirectiveFilterDirs=16 + + # Prepare the command to request completions for the program. + # Split the command at the first space to separate the program and arguments. + $Program,$Arguments = $Command.Split(" ",2) + + $RequestComp="$Program __completeNoDesc $Arguments" + __restic_debug "RequestComp: $RequestComp" + + # we cannot use $WordToComplete because it + # has the wrong values if the cursor was moved + # so use the last argument + if ($WordToComplete -ne "" ) { + $WordToComplete = $Arguments.Split(" ")[-1] + } + __restic_debug "New WordToComplete: $WordToComplete" + + + # Check for flag with equal sign + $IsEqualFlag = ($WordToComplete -Like "--*=*" ) + if ( $IsEqualFlag ) { + __restic_debug "Completing equal sign flag" + # Remove the flag part + $Flag,$WordToComplete = $WordToComplete.Split("=",2) + } + + if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) { + # If the last parameter is complete (there is a space following it) + # We add an extra empty parameter so we can indicate this to the go method. + __restic_debug "Adding extra empty parameter" + # We need to use `"`" to pass an empty argument a "" or '' does not work!!! + $RequestComp="$RequestComp" + ' `"`"' + } + + __restic_debug "Calling $RequestComp" + # First disable ActiveHelp which is not supported for Powershell + $env:RESTIC_ACTIVE_HELP=0 + + #call the command store the output in $out and redirect stderr and stdout to null + # $Out is an array contains each line per element + Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null + + # get directive from last line + [int]$Directive = $Out[-1].TrimStart(':') + if ($Directive -eq "") { + # There is no directive specified + $Directive = 0 + } + __restic_debug "The completion directive is: $Directive" + + # remove directive (last element) from out + $Out = $Out | Where-Object { $_ -ne $Out[-1] } + __restic_debug "The completions are: $Out" + + if (($Directive -band $ShellCompDirectiveError) -ne 0 ) { + # Error code. No completion. + __restic_debug "Received error from custom completion go code" + return + } + + $Longest = 0 + $Values = $Out | ForEach-Object { + #Split the output in name and description + $Name, $Description = $_.Split("`t",2) + __restic_debug "Name: $Name Description: $Description" + + # Look for the longest completion so that we can format things nicely + if ($Longest -lt $Name.Length) { + $Longest = $Name.Length + } + + # Set the description to a one space string if there is none set. + # This is needed because the CompletionResult does not accept an empty string as argument + if (-Not $Description) { + $Description = " " + } + @{Name="$Name";Description="$Description"} + } + + + $Space = " " + if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) { + # remove the space here + __restic_debug "ShellCompDirectiveNoSpace is called" + $Space = "" + } + + if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or + (($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) { + __restic_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported" + + # return here to prevent the completion of the extensions + return + } + + $Values = $Values | Where-Object { + # filter the result + $_.Name -like "$WordToComplete*" + + # Join the flag back if we have an equal sign flag + if ( $IsEqualFlag ) { + __restic_debug "Join the equal sign flag back to the completion value" + $_.Name = $Flag + "=" + $_.Name + } + } + + if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) { + __restic_debug "ShellCompDirectiveNoFileComp is called" + + if ($Values.Length -eq 0) { + # Just print an empty string here so the + # shell does not start to complete paths. + # We cannot use CompletionResult here because + # it does not accept an empty string as argument. + "" + return + } + } + + # Get the current mode + $Mode = (Get-PSReadLineKeyHandler | Where-Object {$_.Key -eq "Tab" }).Function + __restic_debug "Mode: $Mode" + + $Values | ForEach-Object { + + # store temporary because switch will overwrite $_ + $comp = $_ + + # PowerShell supports three different completion modes + # - TabCompleteNext (default windows style - on each key press the next option is displayed) + # - Complete (works like bash) + # - MenuComplete (works like zsh) + # You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function + + # CompletionResult Arguments: + # 1) CompletionText text to be used as the auto completion result + # 2) ListItemText text to be displayed in the suggestion list + # 3) ResultType type of completion result + # 4) ToolTip text for the tooltip with details about the object + + switch ($Mode) { + + # bash like + "Complete" { + + if ($Values.Length -eq 1) { + __restic_debug "Only one completion left" + + # insert space after value + [System.Management.Automation.CompletionResult]::new($($comp.Name | __restic_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + + } else { + # Add the proper number of spaces to align the descriptions + while($comp.Name.Length -lt $Longest) { + $comp.Name = $comp.Name + " " + } + + # Check for empty description and only add parentheses if needed + if ($($comp.Description) -eq " " ) { + $Description = "" + } else { + $Description = " ($($comp.Description))" + } + + [System.Management.Automation.CompletionResult]::new("$($comp.Name)$Description", "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)") + } + } + + # zsh like + "MenuComplete" { + # insert space after value + # MenuComplete will automatically show the ToolTip of + # the highlighted value at the bottom of the suggestions. + [System.Management.Automation.CompletionResult]::new($($comp.Name | __restic_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } + + # TabCompleteNext and in case we get something unknown + Default { + # Like MenuComplete but we don't want to add a space here because + # the user need to press space anyway to get the completion. + # Description will not be shown because that's not possible with TabCompleteNext + [System.Management.Automation.CompletionResult]::new($($comp.Name | __restic_escapeStringWithSpecialChars), "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } + } + + } +} + +Register-ArgumentCompleter -CommandName 'restic' -ScriptBlock $__resticCompleterBlock