Skip to content

Print borg create --list --dry-run to STDOUT to allow combination with --paths-from-stdin #8710

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

Open
mlell opened this issue Mar 28, 2025 · 1 comment

Comments

@mlell
Copy link

mlell commented Mar 28, 2025

Currently, borg seems to list files to STDERR, which prevents its use in UNIX pipes. Of course, I could redirect 2>&1 but it would also include error messages and password prompts. The primary purpose of borg create --list --dry-run ... is to list files, so one could argue that therefore this should go to STDOUT and not STDERR. Also, this allows to use the borg pattern matching, then processing these somehow and finally pipe them back to borg create ... --paths-from-stdin.

My use-case is the following: I am using the pcloud remote of rclone to back up my data. This is slow when many small files are involved. As a test I arbitrarily tried to upload the git repo of opendataeditor and saw from vnstat -l that upload speed is only a few kbit/s. As it was noted that multiple parallel borg2 processes can concurrently write to the same repo, I did exactly that.

However, these processes tended to "clump together" uploading the same files at the same time, which is why I wanted to shuffle the file order so that the different upload processes do not interfere as much. This is where borg create --list --dry-run ... | shuf would become handy.

@ThomasWaldmann
Copy link
Member

borg uses logging a lot and all that output goes to stderr by default.

that is done like this because some commands / options have data flowing over stdout.

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

No branches or pull requests

2 participants