B2_Command_Line_Tool icon indicating copy to clipboard operation
B2_Command_Line_Tool copied to clipboard

how to quiet down sync

Open meonkeys opened this issue 3 years ago • 3 comments

The sync command logs stuff to stdout even if --noProgress is used. I'm seeing:

upload blah
upload foo
upload bar

Is there a command line flag to quiet that down? I'm concerned I might miss something by redirecting stdout to /dev/null. I'm looking for something like rsync's --quiet flag to suppress non-error messages, but that doesn't seem to be an option for b2 sync. It would be great if I could also safely suppress any recoverable errors, like when a connection is lost and the client auto-retries. By "safely" I mean I would still like to know if/when there is a fatal non-recoverable condition.

If someone does recommend b2 sync --noProgress src dest > /dev/null, I'll go with that.

meonkeys avatar Jul 29 '22 00:07 meonkeys

> /dev/null should do the trick - any important errors should be put on stderr for you. There could be a --no-action-log option for sync to not announce actions that it runs - I'll leave this issue open as a feature request

ppolewicz avatar Jul 29 '22 08:07 ppolewicz

Awesome, thank you. One more thought, and sorry in advance because I don't have a repro at the moment, but I recall a lot of non-fatal upload retries are logged to stderr, especially when sync'ing lots of large files. If the b2 cli client will auto-recover and keep trying, maybe squelch those too. It makes sense that this conceptual --quiet option would only print fatal errors. I think that's worth adding to my original comment, so I'll edit that (above), too.

meonkeys avatar Jul 29 '22 17:07 meonkeys

You should look at how aws s3 sync deals with this; the arg for that is --only-show-errors. This really needs to be addressed as it creates huge log files (eg you are logging the output from your backup runs).

spicysomtam avatar Aug 01 '22 21:08 spicysomtam

--quiet has been added & released :tada:

mjurbanski-reef avatar Nov 23 '23 20:11 mjurbanski-reef