Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stats gives a stoping error #5415

Closed
EthraZa opened this issue Oct 13, 2020 · 6 comments
Closed

stats gives a stoping error #5415

EthraZa opened this issue Oct 13, 2020 · 6 comments
Assignees
Labels
Milestone

Comments

@EthraZa
Copy link

EthraZa commented Oct 13, 2020

borg create: error: argument -n/--dry-run: not allowed with argument -s/--stats

It could be a warning, but an error is a bit of overreact, I guess.

@ThomasWaldmann
Copy link
Member

borg version?

@ThomasWaldmann
Copy link
Member

This is from current 1.1-maint code:

        if getattr(args, 'stats', False) and getattr(args, 'dry_run', False):
            # the data needed for --stats is not computed when using --dry-run, so we can't do it.
            # for ease of scripting, we just ignore --stats when given with --dry-run.
            logger.warning("Ignoring --stats. It is not supported when using --dry-run.")
            args.stats = False

@EthraZa
Copy link
Author

EthraZa commented Oct 13, 2020

Yep, it's the latest 1.1.14.
It's not being ignored, it's giving up in error.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Oct 13, 2020

Huh, that is strange. Do we deal at different places in borg code with that stuff?

The current 1.1-maint code is not very different from 1.1.14 release code...

Can you give the full borg command?

@ThomasWaldmann ThomasWaldmann added this to the 1.1.15 milestone Oct 13, 2020
@EthraZa
Copy link
Author

EthraZa commented Oct 13, 2020

borg init --encryption none

borg create --list --filter AME --stats --show-rc --compression zstd --exclude-caches --nobsdflags --exclude-from /backup/exclude.txt --dry-run /backup/repo::'{hostname}-{now}' /folder1 /folder2

usage: borg create [-h] [--critical] [--error] [--warning] [--info] [--debug]
                   [--debug-topic TOPIC] [-p] [--log-json]
                   [--lock-wait SECONDS] [--bypass-lock] [--show-version]
                   [--show-rc] [--umask M] [--remote-path PATH]
                   [--remote-ratelimit RATE] [--consider-part-files]
                   [--debug-profile FILE] [--rsh RSH] [-n | -s] [--list]
                   [--filter STATUSCHARS] [--json] [--no-cache-sync]
                   [--no-files-cache] [--stdin-name NAME] [-e PATTERN]
                   [--exclude-from EXCLUDEFILE] [--pattern PATTERN]
                   [--patterns-from PATTERNFILE] [--exclude-caches]
                   [--exclude-if-present NAME] [--keep-exclude-tags]
                   [--exclude-nodump] [-x] [--numeric-owner] [--noatime]
                   [--noctime] [--nobirthtime] [--nobsdflags] [--ignore-inode]
                   [--files-cache MODE] [--read-special] [--comment COMMENT]
                   [--timestamp TIMESTAMP] [-c SECONDS]
                   [--chunker-params PARAMS] [-C COMPRESSION]
                   ARCHIVE [PATH [PATH ...]]
borg create: error: argument -n/--dry-run: not allowed with argument -s/--stats

@ThomasWaldmann
Copy link
Member

It's a bug, borg aborts when parsing args as they are defined in a mutually exclusive group.

Note: the --filter=AME does not give any output when used with --dry-run, because status will be -.

@ThomasWaldmann ThomasWaldmann self-assigned this Oct 13, 2020
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Oct 13, 2020
ThomasWaldmann added a commit that referenced this issue Oct 13, 2020
…-1.1

fix --dry-run and --stats coexistence, fixes #5415
@ghost ghost mentioned this issue Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants