#!/bin/bash for file in ./文件夹名/* do echo $file curl "http://IP:8983/solr/集合名/update?commit=true" --data-binary @$file -H "Content-type:application/json" done
把所有要上传的json文件放在一个文件夹里,在文件夹同一路径下创建这个.sh文件并执行。一个文件上传结束会自动执行下一个文件的上传命令。