hc6538 发表于 2017-12-19 22:39:01

Shell实现循环执行curl向Solr导入json文件

  

#!/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文件并执行。一个文件上传结束会自动执行下一个文件的上传命令。
页: [1]
查看完整版本: Shell实现循环执行curl向Solr导入json文件