目前我正在尝试让我的脚本从网站下载 mysql 文件,但它似乎转到 302 重定向链接。当我在常规(Windows)浏览器中使用完全相同的链接时,它会下载文件。
这是 wget 的输出:
--2013-06-07 09:42:40-- http://6pp.kvdb.net/exports/mysql_sql.txt.gz
Resolving 6pp.kvdb.net... 2a01:7c8:eb:0:95:170:70:116, 212.78.187.48
Connecting to 6pp.kvdb.net|2a01:7c8:eb:0:95:170:70:116|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.d-centralize.nl/exports/mysql_sql.txt.gz [following]
--2013-06-07 09:42:40-- http://www.d-centralize.nl/exports/mysql_sql.txt.gz
Resolving www.d-centralize.nl... 2a00:1450:400c:c03::79, 173.194.66.121
Connecting to www.d-centralize.nl|2a00:1450:400c:c03::79|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-06-07 09:42:40 ERROR 404: Not Found.
如您所见, http: //6pp.kvdb.net/exports/mysql_sql.txt.gz此网址下载文件(在 Windows 浏览器中)。