How to eliminate aws cli s3 progress chatter

0

I'm using the cli to upload files to s3. This is in a batch job, running via cron. I want to email the results of the transfers to myself.

All is working very well, except that the cli seems to insist on a lot of useless chatter. MOST of the output is like the cruft below. That might be useful for testing, or manually uploading files. Probably demos well. But it is in the way in production, when no one is watching the transfer run.

Unfortunately, I can find no way to turn off this noise. Am I missing something? Clearly, s3 is intended, and appropriate, for mission critical production use. But is the cli not intended for production use? I'm not quite sure; the cli seems rather less robust than s3 itself.

. . .
Completed 2.3 MiB/34.0 MiB (12.2 MiB/s) with 1 file(s) remaining
Completed 2.5 MiB/34.0 MiB (13.1 MiB/s) with 1 file(s) remaining
. . .
Completed 12.5 MiB/34.0 MiB (28.6 MiB/s) with 1 file(s) remaining
Completed 12.8 MiB/34.0 MiB (28.2 MiB/s) with 1 file(s) remaining
. . .
Completed 34.0 MiB/34.0 MiB (35.5 MiB/s) with 1 file(s) remaining
upload: projects/ABC/content-Update-15-2017-b.zip to s3://xxxxxxxxxxxxxxxxxxx/projects/ABC/content-Update-15-2017-b.zip

One line of the result, 131 lines of status. That's a signal-to-noise ration of 1-to-131 !!

Edited by: bill-lb on Jan 20, 2017 11:31 AM

bill-lb
asked 7 years ago2297 views
4 Answers
0
Accepted Answer

Hi bill-lb,

You can suppress all messages by using the '--quiet' argument.

Example:

aws s3 cp /tmp/foo s3://bucket/ --quiet

There is also a '--only-show-errors' argument you can use, but there is no argument that allows you to skip the progress. There is an open issue in GitHub:

https://github.com/aws/aws-cli/issues/519

Thanks!

-reynaldolopez

Edited by: reynaldolopez on Jan 22, 2017 1:55 AM

answered 7 years ago
0

What I have wound up doing is redirecting the output to a file, then processing the file:

   cat ${report} | tr '\r' '\n' | sed '/^Completed.**remaining/d'>"${report%%.**}.filtered"  

Not a solution, of course, but an acceptable workaround.

bill-lb
answered 7 years ago
0

There is now a --no-progress flag.

answered 6 years ago
0

Need to upgrade aws cli to use it
sudo pip install --upgrade awscli

Edited by: FYP-Tech on Mar 13, 2018 5:53 PM

Edited by: FYP-Tech on Mar 13, 2018 5:53 PM

answered 6 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions