简体   繁体   English

gsutil 将特定的扩展文件上传到 gcp gcs

[英]gsutil upload specific extension file to gcp gcs

cant upload all file with extension .css in the directory or sub directory to GCS bucket无法将目录或子目录中扩展名为.css的所有文件上传到 GCS 存储桶

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目录深处有一些css个文件

i want to upload all css file to GCS bucket inside plugin folder or it's any sub-folder我想将所有 css 文件上传到插件文件夹内的 GCS 存储桶或其任何子文件夹

The documentation describe this feature and it works as expected文档描述了此功能并且它按预期工作

For my test, I used Cloud Shell with the latest version of gsutil对于我的测试,我使用 Cloud Shell 和最新版本的 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如果要扫描任意目录并导出CSS文件,可以使用这个命令

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM