【发布时间】:2016-05-14 15:15:06
【问题描述】:
我有一个 Jekyll 博客,其目录结构包含许多隐藏文件和目录,例如 .DS_Store、.idea 和 .git。它还具有以_ 开头的中间构建工件和脚本,例如_deploy.sh 和_drafts。
我想编写一个脚本,将所有内容上传到 Google Cloud Storage 上的存储桶中,除了这些隐藏文件和带下划线的工件。
我尝试使用-x 标志,但我的表达式要么排除整个当前目录,不上传任何内容,要么未能排除一些我想排除的内容。
这是我目前所拥有的:
#!/bin/sh
gsutil -m rsync -rx '\..*|./[.].*$|_*' ./ gs://my-bucket.com/path
我正在观察的输出:
$ ./_deployblog.sh
Building synchronization state...
Starting synchronization
【问题讨论】:
标签: jekyll google-cloud-storage google-cloud-platform gsutil