简体   繁体   English

如何制作一个 cron.yaml 文件以每小时运行一次 python 脚本,用于谷歌云应用引擎

[英]How can I make a cron.yaml file to run python script every hour for google cloud app engine

So I have this in my cron.yaml:所以我在我的 cron.yaml 中有这个:

cron:
- description: "Google analytics data collection"
  url: /usr/bin/python3.7 /home/amng853/ruby-website/google_analytics_info.py
  schedule: every 1 hours

but it keeps returning:但它不断返回:

ERROR: (gcloud.app.deploy) Server responded with code [500]:
  Internal Server Error.
  <h3>Server Error</h3><p>A server error has occurred.</p>

when I deploy the cron.yaml and I don't know what to do.当我部署 cron.yaml 时,我不知道该怎么做。

I also tried to user python3 instead of python3.7 path but still displays the error.我还尝试使用 python3 而不是 python3.7 路径,但仍然显示错误。 (Yes I have python3.7 and python3 installed) (是的,我安装了 python3.7 和 python3)

In general you can not do this.一般来说,你不能这样做。 You need to create endpoint, and then run that url.您需要创建端点,然后运行该 url。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有一种方法可以运行Google App引擎的cron任务,而不用碰到端点,而是将cron.yaml指向python脚本? - Is there a way to run a Google App engine cron task without hitting an endpoint but rather pointing cron.yaml at a python script? 在 Google App Engine 中设置 Cron.yaml 以处理 Google Cloud Bucket 中的文件。 (Python) - Setting up Cron.yaml in Google App Engine to work with files in Google Cloud Bucket. (python) Google Cloud App Engine Cron无法执行python脚本 - Google Cloud App Engine Cron can't execute python script 使用App Engine的cron API每小时运行一个任务 - Run a task every hour on the hour with App Engine's cron API 如何解释cron.yaml文件中的URL参数? - How to interpret the URL parameter in the cron.yaml file? 如何在Selenium中运行代码以在一天中的特定时间在python脚本而非cron中执行功能 - How can I run code in selenium to execute a function at a specific hour of the day within the python script not cron Google应用程序引擎python cron:app.yaml文件中的testcron.py在做什么? - Google app engine python cron: What is the testcron.py doing in the app.yaml file? 如何使此代码在Google App Engine上流畅运行? - How can i make this code run smoothly on google app engine? 如何让 Python 每天在特定时间运行并每小时重复一次? - How can I make Python run at a specific time everyday and make it repeat every hour? 如何每小时自动运行 web 刮板脚本? - How can I run web scraper script automatically every hour?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM