Archive for January, 2011

JIRA: Auto ReIndex

It can be helpful to schedule a reindex of issues after hours (likely when you are asleep!). Here is the shell script that can make that happen:

#!/bin/sh
### SETTINGS ###
USERNAME=<admin_username>
PASSWORD=<password>
DASHBOARD_PAGE_URL=http://<JIRA_URL>/secure/Dashboard.jspa
INDEX_PAGE_URL=http://<JIRA_URL>/secure/admin/jira/IndexReIndex.jspa
COOKIE_FILE_LOCATION=jiracoookie
### COMMANDS ###
curl -u $USERNAME:$PASSWORD --cookie-jar $COOKIE_FILE_LOCATION --output /dev/null $DASHBOARD_PAGE_URL
curl --cookie $COOKIE_FILE_LOCATION --header "X-Atlassian-Token: no-check" -d "indexPathOption=DEFAULT" -d "Re-Index=Re-Index" -d "indexPath=" --output /dev/null $INDEX_PAGE_URL
rm $COOKIE_FILE_LOCATION
Advertisements

7 Comments