Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Shell script to delete Elastic Search indices older than given amount of days.

Notifications You must be signed in to change notification settings

dougbacelar/delete-old-elastic-search-indices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

delete-old-elastic-search-indices

Shell script that deletes Elastic Search indices older than given amount of days

It will send a number of DELETE requests to the host specified. Will preserve indexes newer than the number of days specified on parameter.

Warning

This script will REMOVE Elastic Search indices PERMANENTLY. Use it with care and at your own risk.

Note

The script assumes your indices are named on the following format: name-yyyy.mm.dd. E.g. my-index-2018.02.02

Usage

Run the script with the host url as the first parameter and number of days as second parameter.

To delete indices from localhost:9200 older than 30 days:

./delete_indices_older_than_n_days.sh http://localhost:9200 30

About

Shell script to delete Elastic Search indices older than given amount of days.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages