【问题标题】:convert wget cron command to curl将 wget cron 命令转换为 curl
【发布时间】:2014-09-22 11:30:47
【问题描述】:

我想将以下 wget cron 命令更改为 curl 格式:

wget https://www.yoursite.com/index.php?route=cronjob/cronjob -O /dev/null

wget --quiet --delete-after "http://www.yoursite.com/index.php?route=cron/abandoned_cart_reminder&secret_code=yourcode"

谢谢!

【问题讨论】:

  • 很好,但你有什么问题?
  • 这里有很多例子可以给你一个起点:thegeekstuff.com/2012/07/wget-curl
  • 我正在寻求帮助以将特定的 wget 命令更改为 curl 命令。我仔细查看了这个论坛和其他人的很多帖子,我自己在做这件事时遇到了问题,这就是为什么我有一个单独的帖子。
  • 请在您的问题中澄清。你有什么“问题”?
  • 问题:我不熟悉 wget 和 curl 命令。我有两个 wget 命令,我想将它们更改为 curl 命令。我不确定我能清楚多少。

标签: curl cron wget cron-task


【解决方案1】:

如果您只想从 URL 下载内容,可以(相当)类似地使用命令 wgetcurl。请注意,man 文档中提供了每个命令的以下内容。

语法

wget [options] [URL]
curl [options] [URL]

选项

要指定下载位置,wget 使用-O,而curl 使用-o

为了使输出静音,wget 使用 --quietcurl 使用 --silent

要删除完成后下载的每个文件,wget 使用--delete-after。我不相信curl 有相关选项(它可能会自动执行此操作)。


所以你的第一个命令的直接翻译是:

wget https://www.yoursite.com/index.php?route=cronjob/cronjob -O /dev/null
curl https://www.yoursite.com/index.php?route=cronjob/cronjob -o /dev/null

有意义吗?

每个命令都有lots of examples 在线和大量文档在man 页面上。

【讨论】:

  • 在我的情况下,我用 curl myadres >> outName.sh 替换
猜你喜欢
  • 2019-06-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-01
  • 1970-01-01
  • 2016-06-08
相关资源
最近更新 更多