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

前端 未结 4 423
忘掉有多难
忘掉有多难 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 06:56

    There is not a built in scheduler for Compute Engine instances.

    You can use App Engine's cron scheduler to make Compute Engine API calls. Here is a sample app which uses cron to list instances and delete ones which have been running for more than 8 hours.

    You could do something similar, by making an App Engine url which starts an instance with a startup script which runs your task, copies the data to Cloud Storage and then shuts down the instance as soon as it is complete. Then, create the cron job to hit that URL on your schedule.

提交回复
热议问题