Skip to content

Instantly share code, notes, and snippets.

@peterdietz
Created October 19, 2015 15:33
Show Gist options
  • Save peterdietz/84191eff3f877f30a5bc to your computer and use it in GitHub Desktop.
Save peterdietz/84191eff3f877f30a5bc to your computer and use it in GitHub Desktop.
Export a date-range of DSpace solr statistics
## Export last 60 days of solr statistics, I really only want to grab Sept 8 - Oct 11
bin/dspace solr-export-statistics -l 60 -a export -i statistics
## Delete everything in August
find /home/arcticcouncil/solr-export -type f -print0 | xargs -0 sed -i '/2015-08-/d'
## Delete Sept 1 - 7
find /home/arcticcouncil/solr-export -type f -print0 | xargs -0 sed -i '/2015-09-0[0-7]/d'
## Leave Sept 8 - Oct 11 alone
## Delete Oct 12-19
find /home/arcticcouncil/solr-export -type f -print0 | xargs -0 sed -i '/2015-10-1[2-9]/d'
## Today is the 19th, so there are no more dates in future to remove (i.e. 20-31)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment