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
已提問 7 年前檢視次數 2400 次
4 個答案
0
已接受的答案

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

已回答 7 年前
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
已回答 7 年前
0

There is now a --no-progress flag.

已回答 6 年前
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

已回答 6 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南