Automatically closing indices older than 2 days

Hi,

I am trying to add a cron job that will automatically close indices older
than 2 days(to free up RAM,not enough RAM on nodes )

Here is a brief snippet of the script (in $indexName i have extracted the
index name)

curlStr="curl -XPOST 'localhost:9200/$indexName/_close'"
curl $curlStr

I get the following error when i run the script:
curl: (6) Couldn't resolve host ''localhost'

I know this has to do with my bash scripting abilities and not ES as such
:slight_smile: However, i am hoping to get suggestions on how you might be handling
similar situations? Any solution to the above problem would be nice too :slight_smile:

Thanks in advance,
Shankar

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

On Mar 26, 2013 6:00 PM, "Vikram Shankar" austinium@gmail.com wrote:

Hi,

I am trying to add a cron job that will automatically close indices older
than 2 days(to free up RAM,not enough RAM on nodes )

Here is a brief snippet of the script (in $indexName i have extracted the
index name)

Please ignore the error in the string below, the actual string in the
script doesn't have the extra curl

curlStr="curl -XPOST 'localhost:9200/$indexName/_close'"
curl $curlStr

I get the following error when i run the script:
curl: (6) Couldn't resolve host ''localhost'

I know this has to do with my bash scripting abilities and not ES as such
:slight_smile: However, i am hoping to get suggestions on how you might be handling
similar situations? Any solution to the above problem would be nice too :slight_smile:

Thanks in advance,
Shankar

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/nJOO03Fstz8/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hello Vicky,

I'm no bash wizard either, but it's definitely the single quotes that
bothers it. Something like this should work:
INDEX="a"
curlstr="-XPOST localhost:9200/$INDEX/_close"
curl $curlstr

Best regards,
Radu

http://sematext.com/ -- ElasticSearch -- Solr -- Lucene

On Tue, Mar 26, 2013 at 3:12 PM, Vicky austinium@gmail.com wrote:

On Mar 26, 2013 6:00 PM, "Vikram Shankar" austinium@gmail.com wrote:

Hi,

I am trying to add a cron job that will automatically close indices
older than 2 days(to free up RAM,not enough RAM on nodes )

Here is a brief snippet of the script (in $indexName i have extracted
the index name)

Please ignore the error in the string below, the actual string in the
script doesn't have the extra curl

curlStr="curl -XPOST 'localhost:9200/$indexName/_close'"
curl $curlStr

I get the following error when i run the script:
curl: (6) Couldn't resolve host ''localhost'

I know this has to do with my bash scripting abilities and not ES as
such :slight_smile: However, i am hoping to get suggestions on how you might be
handling similar situations? Any solution to the above problem would be
nice too :slight_smile:

Thanks in advance,
Shankar

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/nJOO03Fstz8/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks, that fixed it :slight_smile:
Its strange how it works with the single quotes when run from the command
line (instead of being run from a script)
On Mar 27, 2013 7:22 PM, "Radu Gheorghe" radu.gheorghe@sematext.com wrote:

Hello Vicky,

I'm no bash wizard either, but it's definitely the single quotes that
bothers it. Something like this should work:
INDEX="a"
curlstr="-XPOST localhost:9200/$INDEX/_close"
curl $curlstr

Best regards,
Radu

http://sematext.com/ -- ElasticSearch -- Solr -- Lucene

On Tue, Mar 26, 2013 at 3:12 PM, Vicky austinium@gmail.com wrote:

On Mar 26, 2013 6:00 PM, "Vikram Shankar" austinium@gmail.com wrote:

Hi,

I am trying to add a cron job that will automatically close indices
older than 2 days(to free up RAM,not enough RAM on nodes )

Here is a brief snippet of the script (in $indexName i have extracted
the index name)

Please ignore the error in the string below, the actual string in the
script doesn't have the extra curl

curlStr="curl -XPOST 'localhost:9200/$indexName/_close'"
curl $curlStr

I get the following error when i run the script:
curl: (6) Couldn't resolve host ''localhost'

I know this has to do with my bash scripting abilities and not ES as
such :slight_smile: However, i am hoping to get suggestions on how you might be
handling similar situations? Any solution to the above problem would be
nice too :slight_smile:

Thanks in advance,
Shankar

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/nJOO03Fstz8/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/nJOO03Fstz8/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.