【发布时间】:2013-03-09 12:30:23
【问题描述】:
我在 bash 中编写了一个较长的部署脚本,我在 cygwin 下运行。如果部署到远程服务器,脚本将使用 curl 将生成的应用上传到 FTP 服务器,如下所示:
if [ $where == "remote" ]
then
for i in `find deploy/ -type f`; do
curl.exe -u "***:***" -T $i "ftp://address.co.uk/public_html/java/desktop/$i"
done
fi
问题是有时 curl 无法完成上传,只是坐在那里阻止其他下载显示
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:15:14 --:--:-- 0
这个特定文件约为 2.5KB,所以它不应该花那么长时间...我必须终止脚本并重新开始...直到所有文件都正确上传。
我尝试添加 & 以在后台运行它,但在所有上传开始的地方我得到了很多 curl: (28) Timeout was reached。
如何修复我的脚本以正常上传文件?
【问题讨论】:
标签: bash curl upload ftp cygwin