我遇到一个问题,gsutil似乎没有遵循文档中描述的行为(至少在Windows中).文件说明:
执行递归目录副本时,将构造对象名称,从递归处理开始镜像源目录结构.例如,命令:
gsutil cp -R dir1/dir2 gs://my_bucket
Run Code Online (Sandbox Code Playgroud)
将创建名为like的对象gs://my_bucket/dir2/a/b/c,假设dir1/dir2包含该文件a/b/c.
但是,在实践中我发现它将创建名为的对象:
gs://my_bucket/dir1/dir2/a/b/c
Run Code Online (Sandbox Code Playgroud)
即,它复制命令中声明的整个目录路径gsutil,而不是如文档中所述"从递归处理点开始"(dir2).
我在这里错过/误解了什么吗?
我使用 gsutil 将文件从 Windows 计算机传输到 Google Cloud Storage。
我已经有 6 个多月没有使用它了,现在当我尝试它时,我得到:
失败:invalid_grant
通过研究,我怀疑访问令牌不再有效,因为它已经 6 个月没有使用了,我需要刷新令牌吗?
我似乎找不到如何获取和使用它。
谢谢
运行gsutil -DD config会产生以下输出:
C:\Python27>python c:/gsutil/gsutil -DD config
DEBUG:boto:path=/pub/gsutil.tar.gz
DEBUG:boto:auth_path=/pub/gsutil.tar.gz
DEBUG:boto:Method: HEAD
DEBUG:boto:Path: /pub/gsutil.tar.gz
DEBUG:boto:Data:
DEBUG:boto:Headers: {}
DEBUG:boto:Host: storage.googleapis.com
DEBUG:boto:Params: {}
DEBUG:boto:establishing HTTPS connection: host=storage.googleapis.com, kwargs={'timeout': 70}
DEBUG:boto:Token: None
DEBUG:oauth2_client:GetAccessToken: checking cache for key *******************************
DEBUG:oauth2_client:FileSystemTokenCache.GetToken: key=******************************* not present (cache_file= c:\users\admini~1\appdata\local\temp\2\oauth2_client-tokencache._.ea******************************)
DEBUG:oauth2_client:GetAccessToken: token from cache: None
DEBUG:oauth2_client:GetAccessToken: fetching fresh access token...
INFO:oauth2client.client:Refreshing access_token connect: (accounts.google.com, 443)
send: 'POST /o/oauth2/token HTTP/1.1\r\nHost: accounts.google.com\r\nContent-Length: 177\r\ncontent-type: …Run Code Online (Sandbox Code Playgroud)