Add "--repository" flag to the "rcreate" action. Add "--progress" flag to the "transfer" action.
This commit is contained in:
parent
d7a07f0428
commit
2a36a2a312
5 changed files with 36 additions and 6 deletions
3
NEWS
3
NEWS
|
@ -6,6 +6,9 @@
|
|||
action.
|
||||
* Fix the "create" action with the "--dry-run" flag querying for databases when a PostgreSQL/MySQL
|
||||
"all" database is configured. Now, these queries are skipped due to the dry run.
|
||||
* Add "--repository" flag to the "rcreate" action to optionally select one configured repository to
|
||||
create.
|
||||
* Add "--progress" flag to the "transfer" action, new in Borg 2.0.0b5.
|
||||
|
||||
1.7.7
|
||||
* #642: Add MySQL database hook "add_drop_database" configuration option to control whether dumped
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import logging
|
||||
|
||||
import borgmatic.borg.rcreate
|
||||
import borgmatic.config.validate
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -17,6 +18,11 @@ def run_rcreate(
|
|||
'''
|
||||
Run the "rcreate" action for the given repository.
|
||||
'''
|
||||
if rcreate_arguments.repository and not borgmatic.config.validate.repositories_match(
|
||||
repository, rcreate_arguments.repository
|
||||
):
|
||||
return
|
||||
|
||||
logger.info('{}: Creating repository'.format(repository))
|
||||
borgmatic.borg.rcreate.create_repository(
|
||||
global_arguments.dry_run,
|
||||
|
|
|
@ -2,7 +2,7 @@ import logging
|
|||
|
||||
import borgmatic.logger
|
||||
from borgmatic.borg import environment, flags
|
||||
from borgmatic.execute import execute_command
|
||||
from borgmatic.execute import DO_NOT_CAPTURE, execute_command
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -28,6 +28,7 @@ def transfer_archives(
|
|||
+ (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
|
||||
+ flags.make_flags('remote-path', remote_path)
|
||||
+ flags.make_flags('lock-wait', storage_config.get('lock_wait', None))
|
||||
+ (('--progress',) if transfer_arguments.progress else ())
|
||||
+ (
|
||||
flags.make_flags(
|
||||
'match-archives', transfer_arguments.match_archives or transfer_arguments.archive
|
||||
|
@ -45,6 +46,7 @@ def transfer_archives(
|
|||
return execute_command(
|
||||
full_command,
|
||||
output_log_level=logging.ANSWER,
|
||||
output_file=DO_NOT_CAPTURE if transfer_arguments.progress else None,
|
||||
borg_local_path=local_path,
|
||||
extra_environment=environment.make_environment(storage_config),
|
||||
)
|
||||
|
|
|
@ -247,6 +247,10 @@ def make_parsers():
|
|||
metavar='KEY_REPOSITORY',
|
||||
help='Path to an existing Borg repository whose key material should be reused (Borg 2.x+ only)',
|
||||
)
|
||||
rcreate_group.add_argument(
|
||||
'--repository',
|
||||
help='Path of the new repository to create (must be already specified in a borgmatic configuration file), defaults to the configured repository if there is only one',
|
||||
)
|
||||
rcreate_group.add_argument(
|
||||
'--copy-crypt-key',
|
||||
action='store_true',
|
||||
|
@ -292,6 +296,12 @@ def make_parsers():
|
|||
'--upgrader',
|
||||
help='Upgrader type used to convert the transfered data, e.g. "From12To20" to upgrade data from Borg 1.2 to 2.0 format, defaults to no conversion',
|
||||
)
|
||||
transfer_group.add_argument(
|
||||
'--progress',
|
||||
default=False,
|
||||
action='store_true',
|
||||
help='Display progress as each archive is transferred',
|
||||
)
|
||||
transfer_group.add_argument(
|
||||
'-a',
|
||||
'--match-archives',
|
||||
|
|
|
@ -169,12 +169,21 @@ The `--source-repository` flag is necessary to reuse key material from your
|
|||
Borg 1 repository so that the subsequent data transfer can work.
|
||||
|
||||
The `--encryption` value above selects the same chunk ID algorithm (`blake2`)
|
||||
used in Borg 1, thereby making deduplication work across transferred archives
|
||||
and new archives. Note that `repokey-blake2-chacha20-poly1305` may be faster
|
||||
than `repokey-blake2-aes-ocb` on certain platforms like ARM64. Read about
|
||||
[Borg encryption
|
||||
commonly used in Borg 1, thereby making deduplication work across transferred
|
||||
archives and new archives.
|
||||
|
||||
If you get an error about "You must keep the same ID hash" from Borg, that
|
||||
means the encryption value you specified doesn't correspond to your source
|
||||
repository's chunk ID algorithm. In that case, try not using `blake2`:
|
||||
|
||||
```bash
|
||||
borgmatic rcreate --verbosity 1 --encryption repokey-aes-ocb \
|
||||
--source-repository original.borg --repository upgraded.borg
|
||||
```
|
||||
|
||||
Read about [Borg encryption
|
||||
modes](https://borgbackup.readthedocs.io/en/2.0.0b5/usage/rcreate.html#encryption-mode-tldr)
|
||||
for the menu of available encryption modes.
|
||||
for more details.
|
||||
|
||||
To transfer data from your original Borg 1 repository to your newly created
|
||||
Borg 2 repository:
|
||||
|
|
Loading…
Reference in a new issue