Install CKAN cronjob

This commit is contained in:
Disassembler 2017-12-20 22:46:18 +01:00
parent 21fcde7b2d
commit bfd15b9eef
3 changed files with 5 additions and 11 deletions

11
ckan.sh
View File

@ -1,13 +1,5 @@
#!/bin/sh #!/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 SOURCE_DIR=${SOURCE_DIR}/ckan
# Build Docker container # 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 service nginx reload
# Install cron job # Install cron job
#cp ${SOURCE_DIR}/srv/ckan/cron-pageviews.sh /srv/ckan/cron-pageviews.sh cp ${SOURCE_DIR}/etc/periodic/hourly/ckan /etc/periodic/hourly/ckan
#cp ${SOURCE_DIR}/etc/cron.d/ckan /etc/cron.d/ckan
# Add portal application definition # Add portal application definition
portal-app-manager ckan "https://{host}:8403/" "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}" portal-app-manager ckan "https://{host}:8403/" "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}"

View File

@ -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

4
ckan/etc/periodic/hourly/ckan Executable file
View File

@ -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