应用引擎gcloud:在主目录中找不到Python文件,但它们是实时的?

2024-04-25 01:25:58 发布

您现在位置:Python中文网/ 问答频道 /正文


Tags: python
1条回答
网友
1楼 · 发布于 2024-04-25 01:25:58

由于不活动,您的云shell主目录可能已被删除。来自Usage limits

If you do not access Cloud Shell for 120 days, we will delete your home disk. You will receive an email notification before we do so and simply starting a session will prevent its removal. Please consider a different solution on Google Cloud Storage for sensitive data you wish to store long term.

除非永久禁用应用程序代码下载,否则可以使用GAE SDK(也可以在云shell中找到)将已部署(仅限标准env)的应用程序代码下载回新的云shell主目录中-有关详细信息,请参阅Downloading Your Source Code

You can download an application's source code by running the appcfg.py command with the download_app action. The appcfg.py download_app command is available through the original App Engine SDK for Python.

appcfg.py -A [YOUR_PROJECT_ID] -V [YOUR_VERSION_ID] download_app [OUTPUT_DIR]

或者从StackDriver复制粘贴文件(冗长乏味)

如果您使用的是灵活的环境,请检查这个答案:Downloading App Engine source code。在

但是一个更好的主意是将代码管理在某个远程存储库中,可以从clodshell机器访问,这样您就可以随时恢复任何版本。可能是Google Cloud Source Repositories,与各种GCP产品集成。在

相关问题 更多 >