Skip to content

Commit 04dfadb

Browse files
cli: rename r* commands to repo-*
also: - adapt tests - adapt BuildMan manpage generation - adapt help strings / doc strings - docs
1 parent a7bfd4a commit 04dfadb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+387
-376
lines changed

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ For ease of use, set the BORG_REPO environment variable::
122122

123123
$ export BORG_REPO=/path/to/repo
124124

125-
Create a new backup repository (see ``borg rcreate --help`` for encryption options)::
125+
Create a new backup repository (see ``borg repo-create --help`` for encryption options)::
126126

127-
$ borg rcreate -e repokey-aes-ocb
127+
$ borg repo-create -e repokey-aes-ocb
128128

129129
Create a new backup archive::
130130

docs/faq.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Can I copy or synchronize my repo to another location?
4141
If you want to have redundant backup repositories (preferably at separate
4242
locations), the recommended way to do that is like this:
4343

44-
- ``borg rcreate repo1 --encryption=X``
45-
- ``borg rcreate repo2 --encryption=X --other-repo=repo1``
44+
- ``borg repo-create repo1 --encryption=X``
45+
- ``borg repo-create repo2 --encryption=X --other-repo=repo1``
4646
- maybe do a snapshot to have stable and same input data for both borg create.
4747
- client machine ---borg create---> repo1
4848
- client machine ---borg create---> repo2
@@ -86,7 +86,7 @@ you could delete the manifest-timestamp and the local cache:
8686

8787
borg config id # shows the REPO_ID
8888
rm ~/.config/borg/security/REPO_ID/manifest-timestamp
89-
borg rdelete --cache-only
89+
borg repo-delete --cache-only
9090

9191
This is an unsafe and unsupported way to use borg, you have been warned.
9292

@@ -355,7 +355,7 @@ are calculated *before* compression. New compression settings
355355
will only be applied to new chunks, not existing chunks. So it's safe
356356
to change them.
357357

358-
Use ``borg rcompress`` to efficiently recompress a complete repository.
358+
Use ``borg repo-compress`` to efficiently recompress a complete repository.
359359

360360
Security
361361
########
@@ -445,7 +445,7 @@ Using ``BORG_PASSCOMMAND`` with a file of proper permissions
445445
Using keyfile-based encryption with a blank passphrase
446446
It is possible to encrypt your repository in ``keyfile`` mode instead of the default
447447
``repokey`` mode and use a blank passphrase for the key file (simply press Enter twice
448-
when ``borg rcreate`` asks for the password). See :ref:`encrypted_repos`
448+
when ``borg repo-create`` asks for the password). See :ref:`encrypted_repos`
449449
for more details.
450450

451451
Using ``BORG_PASSCOMMAND`` with macOS Keychain

docs/quickstart.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ in your backup log files (you check them regularly anyway, right?).
4343

4444
Also helpful:
4545

46-
- use `borg rspace` to reserve some disk space that can be freed when the fs
46+
- use `borg repo-space` to reserve some disk space that can be freed when the fs
4747
does not have free space any more.
4848
- if you use LVM: use a LV + a filesystem that you can resize later and have
4949
some unallocated PEs you can add to the LV.
@@ -332,7 +332,7 @@ Repository encryption
332332

333333
You can choose the repository encryption mode at repository creation time::
334334

335-
$ borg rcreate --encryption=MODE
335+
$ borg repo-create --encryption=MODE
336336

337337
For a list of available encryption MODEs and their descriptions, please refer
338338
to :ref:`borg_rcreate`.
@@ -380,7 +380,7 @@ Borg can initialize and access repositories on remote hosts if the
380380
host is accessible using SSH. This is fastest and easiest when Borg
381381
is installed on the remote host, in which case the following syntax is used::
382382

383-
$ borg -r ssh://user@hostname:port/path/to/repo rcreate ...
383+
$ borg -r ssh://user@hostname:port/path/to/repo repo-create ...
384384

385385
Note: please see the usage chapter for a full documentation of repo URLs.
386386

@@ -396,7 +396,7 @@ it is still possible to use the remote host to store a repository by
396396
mounting the remote filesystem, for example, using sshfs::
397397

398398
$ sshfs user@hostname:/path/to /path/to
399-
$ borg -r /path/to/repo rcreate ...
399+
$ borg -r /path/to/repo repo-create ...
400400
$ fusermount -u /path/to
401401

402402
You can also use other remote filesystems in a similar way. Just be careful,
@@ -502,7 +502,7 @@ Example with **borg mount**:
502502
# open a new, separate terminal (this terminal will be blocked until umount)
503503

504504
# now we find out the archive names we have in the repo:
505-
borg rlist
505+
borg repo-list
506506

507507
# mount one archive from a borg repo:
508508
borg mount -a myserver-system-2019-08-11 /mnt/borg
@@ -528,7 +528,7 @@ Example with **borg extract**:
528528
cd borg_restore
529529

530530
# now we find out the archive names we have in the repo:
531-
borg rlist
531+
borg repo-list
532532

533533
# we could find out the archive contents, esp. the path layout:
534534
borg list myserver-system-2019-08-11

docs/quickstart_example.rst.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
1. Before a backup can be made, a repository has to be initialized::
22

3-
$ borg -r /path/to/repo rcreate --encryption=repokey-aes-ocb
3+
$ borg -r /path/to/repo repo-create --encryption=repokey-aes-ocb
44

55
2. Back up the ``~/src`` and ``~/Documents`` directories into an archive called
66
*Monday*::
@@ -29,7 +29,7 @@
2929

3030
4. List all archives in the repository::
3131

32-
$ borg -r /path/to/repo rlist
32+
$ borg -r /path/to/repo repo-list
3333
Monday Sat, 2022-06-25 20:21:14 [b80e24d2...b179f298]
3434
Tuesday Sat, 2022-06-25 20:21:43 [bcd1b53f...1877718d]
3535

docs/usage/general/environment.rst.inc

+3-3
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ General:
138138

139139
Output formatting:
140140
BORG_LIST_FORMAT
141-
Giving the default value for ``borg list --format=X``.
141+
Giving the default value for ``borg repo-list --format=X``.
142142
BORG_RLIST_FORMAT
143-
Giving the default value for ``borg rlist --format=X``.
143+
Giving the default value for ``borg repo-list --format=X``.
144144
BORG_PRUNE_FORMAT
145145
Giving the default value for ``borg prune --format=X``.
146146

@@ -200,7 +200,7 @@ Directories and files:
200200
- using a full, absolute path to the key file is recommended.
201201
- all directories in the given path must exist.
202202
- this setting forces borg to use the key file at the given location.
203-
- the key file must either exist (for most commands) or will be created (``borg rcreate``).
203+
- the key file must either exist (for most commands) or will be created (``borg repo-create``).
204204
- you need to give a different path for different repositories.
205205
- you need to point to the correct key file matching the repository the command will operate on.
206206
TMPDIR

docs/usage/key.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Examples
99
::
1010

1111
# Create a key file protected repository
12-
$ borg rcreate --encryption=keyfile-aes-ocb -v
12+
$ borg repo-create --encryption=keyfile-aes-ocb -v
1313
Initializing repository at "/path/to/repo"
1414
Enter new passphrase:
1515
Enter same passphrase again:
@@ -37,7 +37,7 @@ Fully automated using environment variables:
3737

3838
::
3939

40-
$ BORG_NEW_PASSPHRASE=old borg rcreate --encryption=repokey-aes-ocb
40+
$ BORG_NEW_PASSPHRASE=old borg repo-create --encryption=repokey-aes-ocb
4141
# now "old" is the current passphrase.
4242
$ BORG_PASSPHRASE=old BORG_NEW_PASSPHRASE=new borg key change-passphrase
4343
# now "new" is the current passphrase.

docs/usage/notes.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ in ``.ssh/authorized_keys``:
234234
command="borg serve --append-only ..." ssh-rsa <key used for not-always-trustable backup clients>
235235
command="borg serve ..." ssh-rsa <key used for backup management>
236236

237-
Running ``borg rcreate`` via a ``borg serve --append-only`` server will *not* create
238-
an append-only repository. Running ``borg rcreate --append-only`` creates an append-only
237+
Running ``borg repo-create`` via a ``borg serve --append-only`` server will *not* create
238+
an append-only repository. Running ``borg repo-create --append-only`` creates an append-only
239239
repository regardless of server settings.
240240

241241
Example
@@ -280,7 +280,7 @@ than what you actually have in the repository now, after the rollback.
280280

281281
Thus, you need to clear the cache::
282282

283-
borg rdelete --cache-only
283+
borg repo-delete --cache-only
284284

285285
The cache will get rebuilt automatically. Depending on repo size and archive
286286
count, it may take a while.

docs/usage/rcompress.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Examples
66
::
77

88
# recompress repo contents
9-
$ borg rcompress --progress --compression=zstd,3
9+
$ borg repo-compress --progress --compression=zstd,3
1010

1111
# recompress and obfuscate repo contents
12-
$ borg rcompress --progress --compression=obfuscate,1,zstd,3
12+
$ borg repo-compress --progress --compression=obfuscate,1,zstd,3

docs/usage/rcreate.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ Examples
99
# Local repository
1010
$ export BORG_REPO=/path/to/repo
1111
# recommended repokey AEAD crypto modes
12-
$ borg rcreate --encryption=repokey-aes-ocb
13-
$ borg rcreate --encryption=repokey-chacha20-poly1305
14-
$ borg rcreate --encryption=repokey-blake2-aes-ocb
15-
$ borg rcreate --encryption=repokey-blake2-chacha20-poly1305
12+
$ borg repo-create --encryption=repokey-aes-ocb
13+
$ borg repo-create --encryption=repokey-chacha20-poly1305
14+
$ borg repo-create --encryption=repokey-blake2-aes-ocb
15+
$ borg repo-create --encryption=repokey-blake2-chacha20-poly1305
1616
# no encryption, not recommended
17-
$ borg rcreate --encryption=authenticated
18-
$ borg rcreate --encryption=authenticated-blake2
19-
$ borg rcreate --encryption=none
17+
$ borg repo-create --encryption=authenticated
18+
$ borg repo-create --encryption=authenticated-blake2
19+
$ borg repo-create --encryption=none
2020

2121
# Remote repository (accesses a remote borg via ssh)
2222
$ export BORG_REPO=ssh://user@hostname/~/backup
2323
# repokey: stores the (encrypted) key into <REPO_DIR>/config
24-
$ borg rcreate --encryption=repokey-aes-ocb
24+
$ borg repo-create --encryption=repokey-aes-ocb
2525
# keyfile: stores the (encrypted) key into ~/.config/borg/keys/
26-
$ borg rcreate --encryption=keyfile-aes-ocb
26+
$ borg repo-create --encryption=keyfile-aes-ocb
2727

docs/usage/rdelete.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Examples
55
::
66

77
# delete the whole repository and the related local cache:
8-
$ borg rdelete
8+
$ borg repo-delete
99
You requested to DELETE the repository completely *including* all archives it contains:
1010
repo Mon, 2016-02-15 19:26:54
1111
root-2016-02-15 Mon, 2016-02-15 19:36:29

docs/usage/rename.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Examples
55
::
66

77
$ borg create archivename ~
8-
$ borg rlist
8+
$ borg repo-list
99
archivename Mon, 2016-02-15 19:50:19
1010

1111
$ borg rename archivename newname
12-
$ borg rlist
12+
$ borg repo-list
1313
newname Mon, 2016-02-15 19:50:19
1414

docs/usage/rinfo.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Examples
44
~~~~~~~~
55
::
66

7-
$ borg rinfo
7+
$ borg repo-info
88
Repository ID: 0e85a7811022326c067acb2a7181d5b526b7d2f61b34470fb8670c440a67f1a9
99
Location: /Users/tw/w/borg/path/to/repo
1010
Encrypted: Yes (repokey AES-OCB)

docs/usage/rlist.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Examples
44
~~~~~~~~
55
::
66

7-
$ borg rlist
7+
$ borg repo-list
88
Monday Mon, 2016-02-15 19:15:11
99
repo Mon, 2016-02-15 19:26:54
1010
root-2016-02-15 Mon, 2016-02-15 19:36:29

docs/usage/transfer.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Examples
1515
# the AEAD cipher does not matter (everything must be re-encrypted and
1616
# re-authenticated anyway), you could also choose repokey-blake2-chacha20-poly1305.
1717
# in case your old borg repo did not use blake2, just remove the "-blake2".
18-
$ borg --repo ssh://borg2@borgbackup/./tests/b20 rcreate \
18+
$ borg --repo ssh://borg2@borgbackup/./tests/b20 repo-create \
1919
--other-repo ssh://borg2@borgbackup/./tests/b12 -e repokey-blake2-aes-ocb
2020

2121
# 2. Check what and how much it would transfer:

scripts/make.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -257,17 +257,25 @@ class BuildMan:
257257
"""build man pages"""
258258

259259
see_also = {
260-
"create": ("delete", "prune", "check", "patterns", "placeholders", "compression", "rcreate"),
260+
"create": ("delete", "prune", "check", "patterns", "placeholders", "compression", "repo-create"),
261261
"recreate": ("patterns", "placeholders", "compression"),
262-
"list": ("info", "diff", "prune", "patterns", "rlist"),
263-
"info": ("list", "diff", "rinfo"),
264-
"rcreate": ("rdelete", "rlist", "check", "benchmark-cpu", "key-import", "key-export", "key-change-passphrase"),
262+
"list": ("info", "diff", "prune", "patterns", "repo-list"),
263+
"info": ("list", "diff", "repo-info"),
264+
"repo-create": (
265+
"repo-delete",
266+
"repo-list",
267+
"check",
268+
"benchmark-cpu",
269+
"key-import",
270+
"key-export",
271+
"key-change-passphrase",
272+
),
265273
"key-import": ("key-export",),
266274
"key-export": ("key-import",),
267275
"mount": ("umount", "extract"), # Would be cooler if these two were on the same page
268276
"umount": ("mount",),
269277
"extract": ("mount",),
270-
"delete": ("compact", "rdelete"),
278+
"delete": ("compact", "repo-delete"),
271279
"prune": ("compact",),
272280
}
273281

src/borg/archiver/prune_cmd.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def build_parser_prune(self, subparsers, common_parser, mid_common_parser):
197197
198198
You can influence how the ``--list`` output is formatted by using the ``--short``
199199
option (less wide output) or by giving a custom format using ``--format`` (see
200-
the ``borg rlist`` description for more details about the format string).
200+
the ``borg repo-list`` description for more details about the format string).
201201
"""
202202
)
203203
subparser = subparsers.add_parser(

src/borg/archiver/repo_compress_cmd.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def get_csettings(c):
103103
return ctype, clevel, olevel
104104

105105
if not isinstance(repository, (Repository, RemoteRepository)):
106-
raise Error("rcompress not supported for legacy repositories.")
106+
raise Error("repo-compress not supported for legacy repositories.")
107107

108108
repo_objs = manifest.repo_objs
109109
ctype, clevel, olevel = get_csettings(repo_objs.compressor) # desired compression set by --compression
@@ -115,7 +115,7 @@ def get_csettings(c):
115115
chunks_limit = min(1000, max(100, recompress_candidate_count // 1000))
116116

117117
pi = ProgressIndicatorPercent(
118-
total=len(recompress_ids), msg="Recompressing %3.1f%%", step=0.1, msgid="rcompress.process_chunks"
118+
total=len(recompress_ids), msg="Recompressing %3.1f%%", step=0.1, msgid="repo_compress.process_chunks"
119119
)
120120
while recompress_ids:
121121
if sig_int and sig_int.action_done():
@@ -173,17 +173,17 @@ def build_parser_repo_compress(self, subparsers, common_parser, mid_common_parse
173173
Please note that this command can not work in low (or zero) free disk space
174174
conditions.
175175
176-
If the ``borg rcompress`` process receives a SIGINT signal (Ctrl-C), the repo
176+
If the ``borg repo-compress`` process receives a SIGINT signal (Ctrl-C), the repo
177177
will be committed and compacted and borg will terminate cleanly afterwards.
178178
179-
Both ``--progress`` and ``--stats`` are recommended when ``borg rcompress``
179+
Both ``--progress`` and ``--stats`` are recommended when ``borg repo-compress``
180180
is used interactively.
181181
182-
You do **not** need to run ``borg compact`` after ``borg rcompress``.
182+
You do **not** need to run ``borg compact`` after ``borg repo-compress``.
183183
"""
184184
)
185185
subparser = subparsers.add_parser(
186-
"rcompress",
186+
"repo-compress",
187187
parents=[common_parser],
188188
add_help=False,
189189
description=self.do_repo_compress.__doc__,

src/borg/archiver/repo_create_cmd.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def do_repo_create(self, args, repository, *, other_repository=None, other_manif
5858
"\n"
5959
"Reserve some repository storage space now for emergencies like 'disk full'\n"
6060
"by running:\n"
61-
" borg rspace --reserve 1G"
61+
" borg repo-space --reserve 1G"
6262
)
6363

6464
def build_parser_repo_create(self, subparsers, common_parser, mid_common_parser):
@@ -79,7 +79,7 @@ def build_parser_repo_create(self, subparsers, common_parser, mid_common_parser)
7979
8080
::
8181
82-
borg rcreate --encryption repokey-aes-ocb
82+
borg repo-create --encryption repokey-aes-ocb
8383
8484
Borg will:
8585
@@ -170,7 +170,7 @@ def build_parser_repo_create(self, subparsers, common_parser, mid_common_parser)
170170
Creating a related repository
171171
+++++++++++++++++++++++++++++
172172
173-
You can use ``borg rcreate --other-repo ORIG_REPO ...`` to create a related repository
173+
You can use ``borg repo-create --other-repo ORIG_REPO ...`` to create a related repository
174174
that uses the same secret key material as the given other/original repository.
175175
176176
By default, only the ID key and chunker secret will be the same (these are important
@@ -185,14 +185,14 @@ def build_parser_repo_create(self, subparsers, common_parser, mid_common_parser)
185185
Creating a related repository for data migration from borg 1.2 or 1.4
186186
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
187187
188-
You can use ``borg rcreate --other-repo ORIG_REPO --from-borg1 ...`` to create a related
188+
You can use ``borg repo-create --other-repo ORIG_REPO --from-borg1 ...`` to create a related
189189
repository that uses the same secret key material as the given other/original repository.
190190
191191
Then use ``borg transfer --other-repo ORIG_REPO --from-borg1 ...`` to transfer the archives.
192192
"""
193193
)
194194
subparser = subparsers.add_parser(
195-
"rcreate",
195+
"repo-create",
196196
parents=[common_parser],
197197
add_help=False,
198198
description=self.do_repo_create.__doc__,

0 commit comments

Comments
 (0)