Google Cloud Storage `gsutil rsync` giving progress results in illegible CRON log

885 views
Skip to first unread message

Haochen Xie

unread,
Oct 12, 2015, 11:50:54 PM10/12/15
to gce-discussion
Hi GCE-Discussion,

Maybe this topic should belongs to somewhere else, but there are no GCS specific mail list listed on Google's document page, nor a general discussion list, so I decided to post it here. Any suggestion to a more appropriate place is welcomed.

I've setup a cron job to automatically backup some folders on my server to a GCS nearline bucket using the following command:

gsutil -m rsync -r /<my-local-data-drive>/git-fat-store gs://<my-bucket>/git-fat-store

but in the cron log mail i got, it seems that gsutil is using console controlling characters to update the progress, which is a really nice feature when used on a real console, but it results illegible log files. Looking at the documentation, I could find no option to suppress the progress, and gsutil seems not be able to distinguish a real console to a pipe. Did I missed something or should I submit a feature request for it? Since gsutil is essentially python, it may not be hard to modify the source file directly, which I'll try to do if I get any spare time.

Thanks in advances.

Haochen

Faizan (Google Cloud Support)

unread,
Oct 13, 2015, 4:46:41 PM10/13/15
to gce-discussion
Hello Haochen,

You can use -q flag with gsutil to run it in quite mode. This will not report progress indicators. You can refer to this link for more information.

I hope that helps.

Faizan

Haochen Xie

unread,
Oct 13, 2015, 6:20:22 PM10/13/15
to Faizan (Google Cloud Support), gce-discussion
Hi Faizan,

Thank you for pointing it out. I haven't considered it before. But from what I've read, the -q switch will suppress not only the progress, but also the file list being copied, and I actually want to see that in my log. I'll experiment with the python code myself at some time, and maybe keep the over verbose log info for now.

Thakns for your help,

Haochen


--

Mail from Haochen Xie

--
© 2014 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to a topic in the Google Groups "gce-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gce-discussion/J641jfYvOak/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gce-discussio...@googlegroups.com.
To post to this group, send email to gce-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/a3f5d525-2bb9-4457-bd62-f890297cbfdb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages