ansible-role-ckan/templates/tracker_update.sh.j2

18 lines
403 B
Django/Jinja

#!/bin/bash
LOCK_DIR={{ ckan_logdir }}
LOCK_FILE=$LOCK_DIR/.index_rebuild.lock
. {{ ckan_virtenv }}/bin/activate
if [ -f $LOCK_FILE ] ; then
echo 'A lock file is present, exiting'
exit 2
fi
echo "cron pid: ${$}" > $LOCK_FILE
paster --plugin=ckan tracking update -c {{ ckan_config_file }}
paster --plugin=ckan search-index rebuild -r -c {{ ckan_config_file }}
rm -f $LOCK_FILE
exit 0