自动脚本关闭和打开

Sni*_*osf 1 google-compute-engine google-cloud-platform

我想知道如何创建一个自动停止并启动Google Compute Engine实例的脚本。以及如何配置他每天运行并选择每周运行5天?

因为我们晚上不使用服务器,所以我每天可以节省9个小时。

能做到吗

谢谢。

Igo*_*nov 5

您可以gcloud为此使用命令行工具(当然是从另一台计算机上使用),它提供所有控件,包括启动和停止实例。在本地计算机上设置cron以:

gcloud compute instances stop INSTANCE_NAMES
gcloud compute instances start INSTANCE_NAMES
Run Code Online (Sandbox Code Playgroud)

看更多: