Skip to content

Instantly share code, notes, and snippets.

@FuhuXia
Created November 24, 2021 15:58
Show Gist options
  • Save FuhuXia/a329c726709d5c7c387ad670c3b34e2e to your computer and use it in GitHub Desktop.
Save FuhuXia/a329c726709d5c7c387ad670c3b34e2e to your computer and use it in GitHub Desktop.
read ckan_ids.txt file and reindex each dataset id
#!/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