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 in GCP by anonymous
• 5,700 points
28 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 by Sirajul
• 38,820 points
How to verify that Cloud Pub/Sub actually got the message?

Related Questions In GCP

0 votes
1 answer

How do I create a Google Cloud Platform (GCP) account?

In order to access the services provided ...READ MORE

answered Sep 20 in GCP by Sirajul
• 38,820 points
52 views
0 votes
1 answer
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 in GCP by Sirajul
• 38,820 points
38 views
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 in GCP by Sirajul
• 38,820 points
48 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 in GCP by Sirajul
• 38,820 points
20 views