From bfd15b9eefce68a517b222b7156d7a7302b8edcb Mon Sep 17 00:00:00 2001 From: Disassembler Date: Wed, 20 Dec 2017 22:46:18 +0100 Subject: [PATCH] Install CKAN cronjob --- ckan.sh | 11 +---------- ckan/etc/cron.d/ckan | 1 - ckan/etc/periodic/hourly/ckan | 4 ++++ 3 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 ckan/etc/cron.d/ckan create mode 100755 ckan/etc/periodic/hourly/ckan diff --git a/ckan.sh b/ckan.sh index 7084815..cc33f69 100755 --- a/ckan.sh +++ b/ckan.sh @@ -1,13 +1,5 @@ #!/bin/sh -SOURCE_DIR=$(realpath $(dirname "${0}")) - -# Check and install linked Docker containers -docker images | grep -q postgres || ${SOURCE_DIR}/postgres.sh -docker images | grep -q redis || ${SOURCE_DIR}/redis.sh -docker images | grep -q solr || ${SOURCE_DIR}/solr.sh -docker images | grep -q ckan-datastore || ${SOURCE_DIR}/ckan-datastore.sh - SOURCE_DIR=${SOURCE_DIR}/ckan # Build Docker container @@ -63,8 +55,7 @@ cp ${SOURCE_DIR}/etc/nginx/conf.d/ckan.conf /etc/nginx/conf.d/ckan.conf service nginx reload # Install cron job -#cp ${SOURCE_DIR}/srv/ckan/cron-pageviews.sh /srv/ckan/cron-pageviews.sh -#cp ${SOURCE_DIR}/etc/cron.d/ckan /etc/cron.d/ckan +cp ${SOURCE_DIR}/etc/periodic/hourly/ckan /etc/periodic/hourly/ckan # Add portal application definition portal-app-manager ckan "https://{host}:8403/" "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}" diff --git a/ckan/etc/cron.d/ckan b/ckan/etc/cron.d/ckan deleted file mode 100644 index 1cd1c76..0000000 --- a/ckan/etc/cron.d/ckan +++ /dev/null @@ -1 +0,0 @@ -10 * * * * ckan /srv/ckan/bin/paster --plugin=ckan tracking update -c /etc/ckan/ckan.ini >/dev/null && /srv/ckan/bin/paster --plugin=ckan search-index rebuild -r -c /etc/ckan/ckan.ini >/dev/null diff --git a/ckan/etc/periodic/hourly/ckan b/ckan/etc/periodic/hourly/ckan new file mode 100755 index 0000000..b58e8dd --- /dev/null +++ b/ckan/etc/periodic/hourly/ckan @@ -0,0 +1,4 @@ +#!/bin/sh + +docker exec ckan paster --plugin=ckan tracking update -c /etc/ckan/ckan.ini >/dev/null +docker exec ckan paster --plugin=ckan search-index rebuild -r -c /etc/ckan/ckan.ini >/dev/null