From aff1a00953eb1d3e7b82110204b3b49eef739446 Mon Sep 17 00:00:00 2001 From: Your Name <you@example.com> Date: Wed, 28 Aug 2019 20:20:44 +0200 Subject: [PATCH] generic --- generic/crontab.bak | 24 ++++++++++ generic/schedule/generic-release.sh | 69 +++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 generic/crontab.bak create mode 100644 generic/schedule/generic-release.sh diff --git a/generic/crontab.bak b/generic/crontab.bak new file mode 100644 index 0000000..572767e --- /dev/null +++ b/generic/crontab.bak @@ -0,0 +1,24 @@ +# Edit this file to introduce tasks to be run by cron. +# +# Each task to run has to be defined through a single line +# indicating with different fields when the task will be run +# and what command to run for the task +# +# To define the time you can provide concrete values for +# minute (m), hour (h), day of month (dom), month (mon), +# and day of week (dow) or use '*' in these fields (for 'any').# +# Notice that tasks will be started based on the cron's system +# daemon's notion of time and timezones. +# +# Output of the crontab jobs (including errors) is sent through +# email to the user the crontab file belongs to (unless redirected). +# +# For example, you can run a backup of all your user accounts +# at 5 a.m every week with: +# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ +# +# For more information see the manual pages of crontab(5) and cron(8) +# +# m h dom mon dow command +#0 0 7 * * /bin/bash -c '/home/extractor/schedule/generic-release.sh' >/dev/null 2>&1 + diff --git a/generic/schedule/generic-release.sh b/generic/schedule/generic-release.sh new file mode 100644 index 0000000..917da69 --- /dev/null +++ b/generic/schedule/generic-release.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +EXTRACTIONFRAMEWORK="/home/extractor/extraction-framework" + +DATABUSMAVENPLUGIN="/data/extraction/databus-maven-plugin/dbpedia/generic" + +LOGS= + +downloadOntology() { + echo " (date) | extraction-framework | start download ontology" >&2; + cd $EXTRACTIONFRAMEWORK/core; + ../run download-ontology; +} + +downloadMappings() { + echo "$(date) | extraction-framework | start download mappings" >&2; + cd $EXTRACTIONFRAMEWORK/core; + ../run download-mappings; +} + +downloadDumps() { + echo "$(date) | extraction-framework | start download dumps" >&2; + cd $EXTRACTIONFRAMEWORK/dump; + ../run download download.spark.properties; +} + +buildExtractionFramework() { + echo "$(date) | extraction-framework | mvn clean install" >&2; + cd $EXTRACTIONFRAMEWORK; + mvn clean install; +} + +runExtraction() { + echo "$(date) | extraction-framework | start extraction" >&2; + cd $EXTRACTIONFRAMEWORK/dump; + ../run sparkextraction extraction.spark.properties; +} + +prepareRelease() { + echo "$(date) | databus-maven-plugin | collect extracted datasetes" >&2; + cd $DATABUSMAVENPLUGIN; + ./collectExtraction.sh; +} + +deployRelease() { + echo "$(date) | databus-maven-plugin | mvn package" >&2; + cd $DATABUSMAVENPLUGIN; + mvn package; + echo "$(date) | databus-maven-plugin | mvn databus:deploy" >&2; + mvn databus:deploy; +} + +main() { + + echo "--------------------" + echo " Generic Extraction " + echo "--------------------" + + downloadOntology; + downloadMappings; + downloadDumps; + + buildExtractionFramework; + runExtraction; + + prepareRelease; + deployRelease; +} + -- GitLab