[英]How to use linux shell command to upload entire directory to ftp server?
[英]How to upload entire directory to artifactory in Linux using curl or any shell script or any commandline utility in Linux?
我試圖將整個目錄上傳到 HTTP 存儲庫,但我無法做到... 有人可以幫我做嗎?
謝謝,巴拉特。
如果您的文件夾結構是 a/b/c ,則執行 zip --> zip -r a.zip a/ 下面的命令將使用您的文件夾結構分解 zip 文件並將文件上傳到目標存儲庫中:
curl -u username:password \
--header "X-Explode-Archive: true" \
-X PUT "http://artifactory.com:8080/artifactory/my-repo/" \
-T path/to/a.zip
您可以嘗試使用以下命令:
curl -v -u admin:admin123 -T test.txt -X PUT http://192.168.xx.xx:8085/repository/testrepo/charts/
這將在 testrepo 存儲庫中創建圖表文件夾,並將 test.txt 文件放在圖表文件夾中。注意:不要忘記將 / 放在圖表文件夾之后。
這對我有用。
for file in *;do
<your working single file upload command executed with "$file" parameter>
done
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.