curl:(56)从对等方接收数据失败

时间:2014-05-03 09:56:52

标签: linux bash curl

你好我在共享主机上,我能够ssh并运行以下命令

 curl -O http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ

它似乎工作正常,并提供以下输出,这对我来说非常好

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed
 0    14    0    14    0     0     35      0 --:--:-- --:--:-- --:--:--    35

但是我使用名为reoccuringinvoices.sh的脚本从cron运行它 脚本的内容就是

#!/bin/bash

curl -O http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ

但是当我从cron运行这个版本时,它会返回以下内容:

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  curl: (56) Failure when receiving data from the peer

说实话,我完全感到困惑,任何帮助开始了解发生的事情都会非常感激

1 个答案:

答案 0 :(得分:-2)

使用wget而不是curl

wget http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ

Curl有写权限吗?

也许创建卷曲日志

curl -O http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ 2>&1 | tee curl.log

或者在-v更改-O并查看日志

curl -v http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ 2>&1 | tee curl.log