SOLR-897: Fixed Argument list too long error when there are lots of snapshots/backups

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@727722 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
William Au 2008-12-18 13:21:33 +00:00
parent c2c78750e8
commit 1514e1fd16
5 changed files with 6 additions and 4 deletions

View File

@ -242,6 +242,8 @@ Bug Fixes
3. SOLR-830: Use perl regex to improve accuracy of finding latest snapshot in snappuller (billa) 3. SOLR-830: Use perl regex to improve accuracy of finding latest snapshot in snappuller (billa)
4. SOLR-897: Fixed Argument list too long error when there are lots of snapshots/backups (Dan Rosher via billa)
================== Release 1.3.0 20080915 ================== ================== Release 1.3.0 20080915 ==================

View File

@ -146,7 +146,7 @@ then
fi fi
# successful commit creates a snapshot file synchronously # successful commit creates a snapshot file synchronously
lastsnap=`ls -drt1 ${data_dir}/snapshot.* 2> /dev/null | tail -1 ` lastsnap=`find ${data_dir} -type d -name 'snapshot.*' 2>/dev/null| sort -r | head -1`
if [[ $lastsnap == "" ]] if [[ $lastsnap == "" ]]
then then

View File

@ -146,7 +146,7 @@ then
fi fi
# successful optimize creates a snapshot file synchronously # successful optimize creates a snapshot file synchronously
lastsnap=`ls -drt1 ${data_dir}/snapshot.* | tail -1 ` lastsnap=`find ${data_dir} -type d -name 'snapshot.*' 2>/dev/null| sort -r | head -1`
if [[ $lastsnap == "" ]] if [[ $lastsnap == "" ]]
then then

View File

@ -122,7 +122,7 @@ elif [[ -n ${num} ]]
then then
logMessage cleaning up all backups except for the most recent ${num} ones logMessage cleaning up all backups except for the most recent ${num} ones
unset backups count unset backups count
backups=`ls -cd ${data_dir}/backup.* 2>/dev/null` backups=`find ${data_dir} -type d -name 'backup.*' 2>/dev/null| sort -r`
if [[ $? == 0 ]] if [[ $? == 0 ]]
then then
count=`echo $backups|wc -w` count=`echo $backups|wc -w`

View File

@ -134,7 +134,7 @@ elif [[ -n ${num} ]]
then then
logMessage cleaning up all snapshots except for the most recent ${num} ones logMessage cleaning up all snapshots except for the most recent ${num} ones
unset snapshots count unset snapshots count
snapshots=`ls -cd ${data_dir}/snapshot.* 2>/dev/null` snapshots=`find ${data_dir} -type d -name 'snapshot.*' 2>/dev/null| sort -r`
if [[ $? == 0 ]] if [[ $? == 0 ]]
then then
count=`echo $snapshots|wc -w` count=`echo $snapshots|wc -w`