Skip to content
Permalink
Browse files

Add a script file which can read pids from a file and send the reinde…

…x requests of those pids to the server.

You need to adjust the server url and credential.
  • Loading branch information
taojing2002 committed Apr 11, 2019
1 parent e7cc2ba commit fbd9c392d0caa11bbd046030e92e160dd052d019
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/scripts/bash/reindex.sh
@@ -0,0 +1,21 @@
#!/bin/bash

###############################################################################
# This script will read a file named ids which contains of list of ids and reindex
# those ids.
# Note: you need to modify the metacat url and provide an JSESSIONID cookie representing a adminitor
################################################################################
inputFileName=ids
metacatURL="https://knb.ecoinformatics.org/knb/metacat?action=reindex&pid="
session="RTGB9E1A83D764CA50B572CD871C5E1C4"
doubleQuote=%22

echo "Here"
while read line || [[ -n "$line" ]];
do
echo "The id is $line"
indexURL=$metacatURL$line
echo "The index url is $indexURL"
curl -k --cookie "JSESSIONID=$session" "$indexURL" || true
sleep 1
done < $inputFileName

0 comments on commit fbd9c39

Please sign in to comment.
You can’t perform that action at this time.