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
• 19,610 points
4,673 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.  

Hope it helps!!

If you need to know more about Google Cloud, We recommend joining GCP Certification course today.

Thanks!

answered Nov 6, 2019 by Sirajul
• 59,230 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 23, 2020 in GCP by MD
• 95,460 points
1,530 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 23, 2020 in GCP by MD
• 95,460 points
678 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 24, 2020 in GCP by MD
• 95,460 points
989 views
0 votes
1 answer

How to create a new project in GCP using the command line?

Hi@akhtar, You need to configure GCP SDK in ...READ MORE

answered Nov 9, 2020 in GCP by MD
• 95,460 points
1,111 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
• 59,230 points
2,851 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
• 59,230 points

edited Jun 16, 2023 by Khan Sarfaraz 1,202 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 24, 2019 in GCP by Sirajul
• 59,230 points
2,566 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP