I am looking to synchronize content between Google bucket and my local directory. I want to ignore certain files while performing this operation.

我希望同步Google存储桶和我的本地目录之间的内容。我想在执行此操作时忽略某些文件。

Like I want to ignore file which ends with country.csv and version.csv at the end.

就像我想忽略最后以country.csv和version.csv结尾的文件。

So I use following regex, which doesn't work

所以我使用以下正则表达式,这是行不通的



    gsutil -m rsync -x ".*country\.csv$|.*version\.csv$" gs://[bucket_id] test/


I have tested this regex on regex101.com

我在regex101.com上测试了这个正则表达式

On the other hand when I try with single regex, it works

另一方面,当我尝试使用单一正则表达式时,它可以工作



    gsutil -m rsync -x ".*country\.csv$" gs://[bucket_id] test/


I am working on windows machine. And I am referring gsutil documentation

我正在使用Windows机器。我指的是gsutil文档

Can any one identify where the problem is ?

任何人都可以确定问题所在吗?

Edit :

Error on gsutil "not recognized as internal or external command, operable program or batch file"

gsutil错误“无法识别为内部或外部命令,可运行程序或批处理文件”

1 个解决方案

#1


2

This ought to work:

这应该工作:

gsutil -m rsync -x ".*country\.csv$^|.*version\.csv$" gs://[bucket_id] test/

See eg How to pass a quoted pipe character to cmd.exe?

请参阅例如如何将带引号的管道字符传递给cmd.exe?

更多相关文章

  1. 使用python api递归计算每个Dropbox文件夹大小
  2. 如何在python中播放wav文件?
  3. python多线程文件传输范例(C/S)
  4. Python - 将值打印到新文件?
  5. 如何让TkInter文件选择对话框与IPython / Spyder一起使用?
  6. 用python将二进制整数或字符串写入文件
  7. 使用pandas read_table读取csv文件
  8. Python -在文本文件中添加日期戳
  9. 在读取和评估文件列表时加速Python eval。

随机推荐

  1. Android(安卓)ApiDemos示例解析(88):Medi
  2. Android获取apk的版本及包名等信息
  3. Android 计算器编程实现
  4. mac 下启动Android Studio 时出现 Androi
  5. Android——文件操作
  6. android studio导入jar 后产生的 gradle
  7. 用ant实现自动打包android(二) -- android
  8. Android禁止Edittext弹出软件盘,光标依然
  9. Android Studio编译中“png-cruncher_*”
  10. Android 判断是否能真正上网