How to create a cron job using Cloud scheduler in GCP?

0 votes
I want to schedule startup and shutdown of my VM instance automatically. I found that they use Cloud scheduler for this purpose. How do I create a cron job using cloud scheduler?
Nov 6, 2019 in GCP by anonymous
• 15,820 points
1,462 views

1 answer to this question.

0 votes

In order to create a Job using Cloud Scheduler, follow these steps: 

  1. Visit the Cloud Scheduler page in the console:

  2. Click the Create job button.

  3. Give your job a name and optionally add a description

  4. Specify the frequency for your job, using the unix-cron format.

    * * * * *
  5. Select your timezone.

  6. In the Target field, select Pub/Sub topic from the dropdown menu and enter the topic you created earlier (cron-topic).

  7. Add a Payload string to be sent to your Cloud Pub/Sub target.

  8. Click Create.

You now have a job that sends a message to your Cloud Pub/Sub topic every minute.  

answered Nov 6, 2019 by Sirajul
• 57,870 points
How to verify that Cloud Pub/Sub actually got the message?

Related Questions In GCP

+2 votes
1 answer

How to create a firewall rule in GCP Cloud?

Hi@akhtar, If you are using the default VPC ...READ MORE

answered Aug 22 in GCP by MD
• 55,020 points
35 views
+2 votes
1 answer

How to create a project in GCP Cloud?

Hi@akhtar, To deploy your app on App Engine, ...READ MORE

answered Aug 22 in GCP by MD
• 55,020 points
27 views
+2 votes
1 answer

How to create a VPC in GCP Cloud?

Hi@akhtar, You can create a private network in ...READ MORE

answered Aug 23 in GCP by MD
• 55,020 points
37 views
0 votes
1 answer

Creating a SQL Server instance using Google Compute engine.

Google Compute Engine provides public images preconfigured with ...READ MORE

answered Sep 23, 2019 in GCP by Sirajul
• 57,870 points
454 views
0 votes
1 answer
0 votes
1 answer

How do i install gcloud compute?

The gcloud compute command-line tool enables you to easily ...READ MORE

answered Sep 23, 2019 in GCP by Sirajul
• 57,870 points
325 views
0 votes
1 answer

How to create a cloud storage bucket in GCP?

Buckets are the basic containers that hold your ...READ MORE

answered Oct 23, 2019 in GCP by Sirajul
• 57,870 points
462 views
0 votes
1 answer