how to schedule the shell script using Google Cloud Shell?

后端 未结 3 833
迷失自我
迷失自我 2021-01-01 07:22

I have a .sh file that is stored in GCS. I am trying to schedule the .sh file through google cloud shell.

I can run the same file using gsutil cat gs://miptest

3条回答
  •  执笔经年
    2021-01-01 07:54

    As per the documentation, Cloud Shell is intended for interactive use only. The Cloud Shell instances are provisioned on a per-user, per-session basis and sessions are terminated after an hour of inactivity.

    In order to schedule a daily cron job, the instance needs to be up and running all time but this doesn’t happen with Cloud Shell and I believe your jobs are not running because of this.

    When you start Cloud Shell, it provisions a f1-micro instance which is the same machine type you can get for free if you are eligible for “Always Free”. Therefore you can create a f1-micro instance, configure the cron job on it and leave it running so it can execute the daily job.

    You can check free usage limits at https://cloud.google.com/compute/pricing#freeusage

提交回复
热议问题