如何使用gsutil查找和复制?

时间:2018-04-26 09:56:15

标签: google-cloud-storage gsutil

我知道怎么做,但有一个简单的方法吗?

touch temp/foo
for i in $(find my-dir/* -newer temp/foo);
do
gsutil -m cp -r "$i" gs://my-bucket/
done

1 个答案:

答案 0 :(得分:3)

The gsutil cp -I parameter should help with this. It allows you to read the list of files to copy from stdin.

I think this would work:

find my-dir/* -newer temp/foo | gsutil -m cp -I gs://my-bucket/