File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,17 +4,18 @@ if [[ ! "$1" ]]; then
44 echo " " "
55Usage: $0 <solr root>
66
7- Create backups for all cores in a solr instance.
7+ Create backups for all cores in a solr instance. Currently hard-coded to keep 3 backups.
88" " "
99 exit 1
1010fi
1111
12- SOLR_ROOT=" ${1?: Usage: $0 <solr root>} "
12+ NUMBER_TO_KEEP=" 3"
13+ SOLR_ROOT=" $1 "
1314
1415command -v jq > /dev/null 2>&1 || { echo >&2 " jq is required but not installed. Aborting." ; exit 1; }
1516command -v curl > /dev/null 2>&1 || { echo >&2 " curl is required but not installed. Aborting." ; exit 1; }
1617
1718for core in $( curl -s $SOLR_ROOT /solr/admin/cores? indexInfo=false | jq -r ' .status' | jq -r ' keys[]' ) ; do
1819 echo " Backing up $core "
19- curl " ${SOLR_ROOT} /solr/${core} /replication?command=backup"
20+ curl " ${SOLR_ROOT} /solr/${core} /replication?command=backup&numberToKeep= ${NUMBER_TO_KEEP} "
2021done
You can’t perform that action at this time.
0 commit comments