Created
October 17, 2013 18:51
-
-
Save yriveiro/7030222 to your computer and use it in GitHub Desktop.
Script to post json data to solr.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for f in *.ready | |
do | |
status=$(curl --write-out %{http_code} --silent --output /dev/null http://192.168.20.101:8983/solr/statistics-$1/update? --data-binary @$f -H 'Content-type:application/json') | |
if [ $status -eq 200 ] | |
then | |
echo "Removing file $f" | |
rm -f $f | |
else | |
echo "File $f not posted. CODE: $status" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment