chagan
chagan

Reputation: 239

gsutil upload specific extension file to gcp gcs

cant upload all file with extension .css in the directory or sub directory to GCS bucket

gsutil -h "Cache-Control:public,max-age=2628000" -h "Content-Encoding:gzip" cp plugins/**.css gs://cdn.test.example.io/wp-content/plugins

response

CommandException: No URLs matched: plugins/**.css

there are some css files deep in the directory

i want to upload all css file to GCS bucket inside plugin folder or it's any sub-folder

Upvotes: 1

Views: 1287

Answers (1)

guillaume blaquiere
guillaume blaquiere

Reputation: 75715

The documentation describe this feature and it works as expected

For my test, I used Cloud Shell with the latest version of gsutil

> gsutil -v
gsutil version: 4.52

Check your version, and update it to see if that solve your issue

However you can also do this to upload only the file of Plugin directory

cd plugins

gsutil -h "Cache-Control:public,max-age=2628000" -h "Content-Encoding:gzip" cp **.css gs://cdn.test.example.io/wp-content/plugins

If you want to scan any directory and export the CSS files, you can use this command

gsutil cp ./**/*.css gs://cdn.test.example.io/wp-content/plugins

Upvotes: 3

Related Questions