Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to import web cronjobs into GCP cloudscheduler

Good day

I am trying to move my cronjobs from web cronjobs to gcp cloudscheduler, i have over 200 of them and inputting them manually would take time,

How can i import them into cloudscheduler?

please help

Solved Solved
1 1 569
1 ACCEPTED SOLUTION

Hi @Wongfei,

Welcome to Google Cloud Community!

There is no direct way to import web cronjobs into GCP Cloud Scheduler. However, you can use the following workaround:
1. Export your web cronjobs to a CSV file.
2. Create a new Cloud Scheduler job for each cronjob in the CSV file.
3. Set the schedule for each job to the cron expression in the CSV file.


Here are the steps in detail:
1. To export your web cronjobs to a CSV file, you can use a cron job scheduler like Crontab Guru. Once you have exported your cronjobs to a CSV file, save it to your computer.
2. In the GCP Console, go to the Cloud Scheduler page.
3. Click Create job.
4. In the Job name field, enter a name for your job.
5. In the Region list, select the region where you want to create your job.
6. In the Schedule field, enter the cron expression for your job. You can find a list of cron expressions here: https://crontab.guru/.
7. In the Job trigger section, select Pub/Sub as the trigger type.
8. In the Pub/Sub topic field, enter the name of the Pub/Sub topic that you want to use to trigger your job.
9.Click Create.
Repeat steps 2-9 for each cronjob in your CSV file.

Once you have created all of your Cloud Scheduler jobs, they will be triggered according to the schedules that you specified.

Here are some additional things to keep in mind when importing web cronjobs into GCP Cloud Scheduler:

  • The cron expressions in your CSV file must be valid cron expressions.
  • The Pub/Sub topic that you use to trigger your jobs must already exist.
  • You can use Cloud Scheduler to trigger other types of jobs, such as HTTP requests and Cloud Functions.

You may also file a feature request in this link so that the Product Team will look into this to verify and if it is possible to apply this kind of feature. However, there is no ETA for this.

Thank you!

View solution in original post

1 REPLY 1

Hi @Wongfei,

Welcome to Google Cloud Community!

There is no direct way to import web cronjobs into GCP Cloud Scheduler. However, you can use the following workaround:
1. Export your web cronjobs to a CSV file.
2. Create a new Cloud Scheduler job for each cronjob in the CSV file.
3. Set the schedule for each job to the cron expression in the CSV file.


Here are the steps in detail:
1. To export your web cronjobs to a CSV file, you can use a cron job scheduler like Crontab Guru. Once you have exported your cronjobs to a CSV file, save it to your computer.
2. In the GCP Console, go to the Cloud Scheduler page.
3. Click Create job.
4. In the Job name field, enter a name for your job.
5. In the Region list, select the region where you want to create your job.
6. In the Schedule field, enter the cron expression for your job. You can find a list of cron expressions here: https://crontab.guru/.
7. In the Job trigger section, select Pub/Sub as the trigger type.
8. In the Pub/Sub topic field, enter the name of the Pub/Sub topic that you want to use to trigger your job.
9.Click Create.
Repeat steps 2-9 for each cronjob in your CSV file.

Once you have created all of your Cloud Scheduler jobs, they will be triggered according to the schedules that you specified.

Here are some additional things to keep in mind when importing web cronjobs into GCP Cloud Scheduler:

  • The cron expressions in your CSV file must be valid cron expressions.
  • The Pub/Sub topic that you use to trigger your jobs must already exist.
  • You can use Cloud Scheduler to trigger other types of jobs, such as HTTP requests and Cloud Functions.

You may also file a feature request in this link so that the Product Team will look into this to verify and if it is possible to apply this kind of feature. However, there is no ETA for this.

Thank you!