Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 为什么这个gsutil调用在FinalBuilder网站上不起作用,但在FinalBuilder应用程序中运行时起作用?_Batch File_Google Cloud Storage_Finalbuilder_Gsutil - Fatal编程技术网

Batch file 为什么这个gsutil调用在FinalBuilder网站上不起作用,但在FinalBuilder应用程序中运行时起作用?

Batch file 为什么这个gsutil调用在FinalBuilder网站上不起作用,但在FinalBuilder应用程序中运行时起作用?,batch-file,google-cloud-storage,finalbuilder,gsutil,Batch File,Google Cloud Storage,Finalbuilder,Gsutil,我有一个.bat文件,它调用以下gsutil将文件推送到谷歌云: python "C:\Program Files (x86)\gsutil\gsutil" -D -m cp -a public-read C:\Temp\MyMSI.msi gs://downloads-gs.mywebsite.com/binaries/myapplication/auto_installer/ 以下是我的输出(由于模糊,更改了一些名称): ----------------------------------

我有一个.bat文件,它调用以下gsutil将文件推送到谷歌云:

python "C:\Program Files (x86)\gsutil\gsutil" -D -m cp -a public-read C:\Temp\MyMSI.msi gs://downloads-gs.mywebsite.com/binaries/myapplication/auto_installer/
以下是我的输出(由于模糊,更改了一些名称):

----------------------------------------------------------
复制到google 11:02:33 AM 11:02:34 AM 00:00:00:479失败(忽略)
折叠消息
信息
崩溃
正在执行外部进程:C:\Windows\system32\cmd.exe
开始目录:C:\BuildScripts
参数:/c“c:\buildscripts\push\u goog.bat”
崩溃
从C:\Windows\system32\cmd.exe输出
系统找不到指定的驱动器。
C:\BuildScripts>pushd C:\BuildScripts\
系统找不到指定的驱动器。
回溯(最近一次呼叫最后一次):
文件“C:\Program Files(x86)\gsutil\gsutil”,第67行,在
使用CRCModextension从gslib.util导入
文件“C:\ProgramFiles(x86)\gsutil\gslib\util.py”,第121行,在
join(createTrackerDirifNeed(),'.last_software_update_check'))
CreateTrackerDirifNeed中的文件“C:\Program Files(x86)\gsutil\gslib\util.py”,第108行
os.makedirs(tracker\u dir)
文件“C:\Python27\lib\os.py”,第150行,在makedirs中
makedirs(头部,模式)
**C:\BuildScripts>python“C:\ProgramFiles(x86)\gsutil\gsutil“-D-MCP-公共阅读C:\Temp\MyMSI.msi gs://downloads-gs.mywebsite.com/binaries/myapplication/auto_installer/**
makedirs中的文件“C:\Python27\lib\os.py”,第157行
mkdir(名称、模式)
WindowsError:[错误3]系统找不到指定的路径:“H:\\\\”
程序返回代码:1

它提到了关于H:\\\的一些东西,我们没有使用它,在.bat文件或gsutil的参数中也从来没有提到过。我不知道为什么它在从FinalBuilder应用程序运行时工作得很好,然后当FinalBuilder网站运行相同的FinalBuilder应用程序文件时,它会出现此错误,但只是通过FinalBuilder服务器触发的


任何帮助都会很好。

根本原因是您的主目录设置为无效位置

作为一种解决方法,您可以在
.boto
配置文件中更改跟踪器目录。以下是相关章节:

[GSUtil]
# 'resumable_tracker_dir' specifies the base location where resumable
# transfer tracker files are saved. By default they're in ~/.gsutil
#resumable_tracker_dir = <file path>
[GSUtil]
#“Resubable_tracker_dir”指定可恢复的基本位置
#传输跟踪器文件已保存。默认情况下,它们位于~/.gsutil中
#可恢复的\u跟踪器\u目录=

取消对
resubable\u tracker\u dir变量的注释,并将其设置为磁盘上确实存在的位置。

您的主目录在哪里?我们过去常常找到它。可以设置为H吗?我明白了!HOMEDRIVE设置为H:。。。问题是,我认为我们需要将服务器上的设置设置为IT目的。有办法吗?我可以硬编码它来告诉目录在哪里,而不是试图找出它吗?.boto配置文件在哪里?它通常在您的主目录中。当您运行gsutil config时,它应该告诉您它的位置。如果需要移动它或再次运行gsutil config,可以设置BOTO_config环境变量来移动配置的位置。具有讽刺意味的是,它通常位于主目录中。幸运的是,您可以通过设置boto_CONFIG环境变量来指定.boto文件的位置。您还可以从命令行设置单独的属性,如:“gsutil-m gsutil:resumable\u tracker\u dir=SOME\u VALID\u PATH rest of command”最终找到了H:\驱动器上的.boto文件,因此我将resumable\u tracker\u dir更改为我刚刚创建的C:\BuildScripts\gsutil。然而,我仍然得到完全相同的错误。当它工作时,它会写入新的目录。当它不起作用时,它甚至不会向该目录写入任何内容。奇怪的是,当我从FinalBuilder应用程序运行它时(在它起作用的地方,它使用新的可恢复的\u tracker\u目录显示它),但当它从FinalBuilder网站失败时,它仍然显示它找不到H:\\\\。。。。为什么这里有4条斜线?我还是不明白那部分。
[GSUtil]
# 'resumable_tracker_dir' specifies the base location where resumable
# transfer tracker files are saved. By default they're in ~/.gsutil
#resumable_tracker_dir = <file path>