[英]How to pass arguments on cron in Google App Engine?
我正在尝试使用参数在Google App Engine中运行cron作业,但无法在cron.yaml中发送任何参数。 有人知道如何在cron.yaml中发送参数吗?
handlers:
- url: /testing
script: testing.php
我要发送的是testing.php?testing = 12345,但是如果我这样写,脚本将无法运行。
我读到这个:
如何在Google App Engine上将参数传递给python cron任务?
..但我对Python并不了解很多。
谢谢!
cron: - description: Testing Cron url: /testing.php?testing=12345 schedule: every 60 mins
根据Google( https://developers.google.com/appengine/docs/php/config/cron )所述,以上应该是正确的语法,请注意使用cron而不是处理程序。
我想知道为什么您要使用查询字符串参数? 如果这是限制访问,则可以通过仅添加管理员登录名来轻松实现:
cron: - description: Testing Cron url: /testing.php?testing=12345 schedule: every 60 mins login: admin
另外,如果您确信在URL末尾添加查询字符串不起作用,则始终可以将不同的URL用于不同的任务...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.