如何传递多个参数到cron工作与curl? [英] How to pass multiple parameters to cron job with curl?
本文介绍了如何传递多个参数到cron工作与curl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在执行两个cron作业:
I'm running two cron jobs:
这个执行顺利:
curl -sS http://example.com/cronjob.php?days=1
$ b b
但这根本不会运行:
But this doesn't run at all:
curl -sS http://example.com/cronjob.php?days=1&month=1
这是因为&符>& )?如果是,如何传递多个参数?
Is this because of the ampersand (&
)? If yes, how to pass multiple parameters?
使用 argv
不是一个选项。 $ b
Using argv
is not an option.
推荐答案
你会注意到这在你的shell中不能正常工作。
You'll notice that this doesn't exactly work in your shell, either.
您需要做的是在网址周围加上单引号,例如:
What you need to do is put single quotes around the URL, like so:
curl -sS 'http://example.com/cronjob.php?days=1&month=1'
这篇关于如何传递多个参数到cron工作与curl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文