gsutil cp -z how can I copy and gzip multiple file types at once
Asked Answered
E

1

6

I have tried gsutil cp -z "js, css, html" file/name gs://bucket/name

Only file type that compressed is js but other type remain uncompress.

Can cp -z command upload and compress multiple file type?

Any suggestion would be appreciate.

Thanks in advance.

Exospore answered 30/5, 2014 at 9:22 Comment(0)
V
13

Please remove the extra whitespace in the file extension list:

gsutil cp -z "js,css,html" file/name gs://bucket/name

I'm going to change the gsutil code to make it ignore the whitespace, so this is less confusing.

Vodka answered 30/5, 2014 at 13:17 Comment(2)
I'm using "gsutil -m cp -z html -r dist gs:/bucket", but my HTML files do not have a Content-Encoding header. Any ideas what I'm doing wrong?Precious
I figured it out - I was copying files to the wrong directory. I changed it to be "gsutil -m cp -z "html,js,css" -r dist/** gs:/bucket" and everything works now.Precious

© 2022 - 2024 — McMap. All rights reserved.