lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Bell <billnb...@gmail.com>
Subject Script to remove all index.* leftovers
Date Tue, 05 Apr 2011 18:46:17 GMT
There is a bug that leaves old index.* directories in the Solr data directory.

Here is a script that will clean it up. I wanted to make sure this is
okay, without doing a core reload.

Thanks.

#!/bin/bash

DIR="/mnt/servers/solr/data"
LIST=`ls $DIR`
INDEX=`cat $DIR/index.properties | grep index\= | awk 'BEGIN { FS =
"=" } ; { print $2 }'`
echo $INDEX

for file in  $LIST
do
        if [ $INDEX == $file -o $file == "index" -o $file ==
"index.properties" -o $file == "replication.properties" -o $file ==
"spellchecker" ]
        then
                echo "skip: $file"
        else
                echo "rm -rf $DIR/$file"
                rm -rf $DIR/$file
        fi
done

Mime
View raw message