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
preguntada hace 7 años2400 visualizaciones
4 Respuestas
0
Respuesta aceptada

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

respondido hace 7 años
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
respondido hace 7 años
0

There is now a --no-progress flag.

respondido hace 6 años
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

respondido hace 6 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas