2017-03-01 46 views
-1

我需要使用命令行從nexus存儲庫下載工件。工件文件名是未知的,但擴展名始終爲*.zip。我正在使用帶有通配符的curl命令。當我執行命令,它說HTTP/1.1 404 Not Found使用通配符通過身份驗證從https url下載文件

curl --insecure -O -u username:password -v https://nexus.internal.org.com/content/repositories/snapshots/com/org/artifact/1.4.0/*.zip

> Accept: */* 
> 
% Total % Received % Xferd Average Speed Time Time  Time Current 
          Dload Upload Total Spent Left Speed 
0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:-- 0< HTTP/1.1 404 Not Found 
< Accept-Ranges: bytes 
< Content-Type: text/html 
< Date: Wed, 01 Mar 2017 22:28:35 GMT 
< Server: Nexus/2.14.2-01 
< X-Content-Type-Options: nosniff 
< X-Frame-Options: SAMEORIGIN 
< transfer-encoding: chunked 
< Connection: keep-alive 

的文件是在URL位置實際存在。我運行的命令是否正常?

+0

Stack Overflow是用於編程和發展問題的站點。這個問題似乎與題目無關,因爲它不涉及編程或開發。請參閱幫助中心的[我可以詢問哪些主題](http://stackoverflow.com/help/on-topic)。也許[超級用戶](http://superuser.com/)或[Unix&Linux堆棧交換](http://unix.stackexchange.com/)會是一個更好的地方。 – jww

回答

1

我發現了一個很好的方式來執行此操作,從基本上請求整個前綴的內容的this answer 中指示,設置一些邊界到遞歸中,並通過類似shell的模式過濾接受的文件。

如果我沒有記錯,命令你想會是什麼:

wget --recursive --level=1 --no-parent --no-directories \ 
    --accept '*.zip' \ 
    --directory-prefix=. \ 
    https://nexus.internal.org.com/content/repositories/snapshots/com/org/artifact/1.4.0/ 
相關問題