Can Google Compute instances be started and stopped on a schedule?

前端 未结 4 416
忘掉有多难
忘掉有多难 2021-02-06 06:17

I run a simple task 3 times a day from my desktop computer. It connects to a certain website at 4pm, 8pm, and 1am, downloads a small amount of data (less then 50mb), and stores

4条回答
  •  孤城傲影
    2021-02-06 07:13

    It's 2020, and yes you can! Follow this easy official guide:

    https://cloud.google.com/scheduler/docs/start-and-stop-compute-engine-instances-on-a-schedule

    ..and change these vars: {"zone":"us-west1-b","label":"env=dev"}

    I haven't found a way to export/import schedules, but would be nice as there's a lot of manual clicking. You can save a couple clicks by using Copy in Functions to clone the first one.

    There is also an option for HTTP triggers by enabling unauthenticated curl messages: https://cloud.google.com/functions/docs/calling/http

    EDIT: spoke too soon, it didnt start my instance even though the function test output said "Successfully started instance(s)"

提交回复
热议问题