如何在不使用 cron 作业的情况下在谷歌云中安排 python 脚本? [英] How to schedule python script in google cloud without using cron jobs?

查看:22
本文介绍了如何在不使用 cron 作业的情况下在谷歌云中安排 python 脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个 python 脚本在本地环境中每天运行一次.一种是获取数据,另一种是对其进行格式化.

I have two python scripts running once a day in my local environment. One is to fetch data and another is to format it.

现在我想将这些脚本部署到 Google 的云环境并每天运行一次/两次.

Now I want to deploy those scripts to Google's cloud environment and run those once/twice a day.

我可以使用 Google Cloud Function 做到这一点,还是需要 App Engine?

Can I do that using Google Cloud Function or do I need App Engine?

为什么没有 cron 作业:因为我不希望我的系统/VM 运行一整天(不使用时).

Why NO cron job: Because I don't want my system/VM to run whole day (when not in use).

我可以使用 Cloud Composer 来实现吗?

Can I use Cloud Composer to achieve that?

推荐答案

您可以使用 Google Cloud Scheduler 这是一个完全托管的企业级 cron 作业调度程序.它允许您安排几乎任何作业,包括批处理、大数据作业、云基础架构操作.

You can use Google Cloud Scheduler which is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations.

每月前 3 个工作是免费的.接下来是每个工作每月 0.10 美元.

The first 3 jobs per month are free. Next are $0.10 per job/month.

这篇关于如何在不使用 cron 作业的情况下在谷歌云中安排 python 脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆