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

No dry-run flags when using borg extract #8564

Open
goebbe opened this issue Nov 24, 2024 · 9 comments
Open

No dry-run flags when using borg extract #8564

goebbe opened this issue Nov 24, 2024 · 9 comments

Comments

@goebbe
Copy link

goebbe commented Nov 24, 2024

Using borg 1.4, I checked the use of "flags" when doing a dry-run for different borg commands.

The command borg extract --dry-run --list does not print the flags (that are used with e.g. borg create / borg recreate
Instead, borg extract prints only the list of items that would be included in the extract without the --dry-run.

This was the command, I used:
borg extract REPO::ARCHIVE /home/user/test Admin -e 'home/user/test/*.bak' --dry-run --verbose --list

In the name of consistency, dry-run flags could be added to borg extract.

@ThomasWaldmann
Copy link
Member

Good idea. It's just questionable if we shall do that for 1.4 or rather put it into 2.0 breaking release.

Not sure if somebody is parsing that output with some automation which would break if we change the format.

@goebbe
Copy link
Author

goebbe commented Nov 24, 2024

I just reported this for borg 1.4, since I found this inconsistency using this version.
From a user's point of view, this is not a big issue - I would rather leave borg 1.4. as it is now and focus on borg 2.0 as suggested.

@goebbe
Copy link
Author

goebbe commented Nov 24, 2024

I shortly looked into this - but unfortunately fixing this is beyond my skills and knowledge. I could not even find the relevant places in the source code. :-D Hopefully somebody more proficient will take this up.

@ThomasWaldmann
Copy link
Member

The starting point for changing how some command works is its implementation in src/borg/archiver/*_cmd.py - and then follow the code from there.

@alighazi288
Copy link

Hi! First time contributor here. Could you please give me some advice on getting started? I would like to start with this as my first problem!

@ThomasWaldmann
Copy link
Member

@alighazi288 Thanks for helping! Did you read the previous comment, where I pointed to the *_cmd.py files. This is where the commands are implemented.

About general borg installation, development setup, etc. please see our docs.

If you have more specific questions, just ask!

@alighazi288
Copy link

Thank you so much! I'll try working on a fix for the problem!

@goebbe
Copy link
Author

goebbe commented Nov 28, 2024

@alighazi288 borg create and borg recreate both print the dry-run flags for items (folders / files), perhaps it is helpful to look at theses, as examples.

When testing borg extract --dry-run --list, it took quite a long time, especially with large files.
This was different from the --dry-run when testing borg create or borg recreate which both went really fast.
I had the impression that borg create --dry-run --list just checks what would happen if the sources / includes/ excludes are applied, whereas in the case of borg extract --dry-run additional computations are done.

@ThomasWaldmann Is there a conceptional difference in what --dry-run should/ could achieve, here? Or should dry-run always just provide feedback on sources/ includes/ excludes?

@ThomasWaldmann
Copy link
Member

There is a massive difference in create and extract dry-run:

  • create --dry-run only recurses into the filesystem, applies include/exclude filtering and logs what was excluded/included. It does not process the files any further (does not read file content, not compress/encrypt/authenticate content data, not write to repo).
  • extract --dry-run does all what a normal extract run would do, except writing the extracted data to the fs. so it reads all data from the repo, authenticates, decrypts, decompresses it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants