Created
November 24, 2021 15:58
-
-
Save FuhuXia/a329c726709d5c7c387ad670c3b34e2e to your computer and use it in GitHub Desktop.
read ckan_ids.txt file and reindex each dataset id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
################ | |
# USAGE: sh ckan_sync.sh > sync.log | |
################ | |
tmpfile='./ckan_ids.txt' | |
while read id | |
do | |
if [ -n "$id" ] | |
then | |
ckan search-index rebuild $id >/dev/null 2>&1 | |
if [ $? -ne 0 ] | |
then | |
echo "error: $id" | |
else | |
echo "updated: $id" | |
fi | |
fi | |
done < $tmpfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment