diff --git a/smartgears/dataminer_app/tasks/dataminer-app.yml b/smartgears/dataminer_app/tasks/dataminer-app.yml index 268e64e6..a50d278d 100644 --- a/smartgears/dataminer_app/tasks/dataminer-app.yml +++ b/smartgears/dataminer_app/tasks/dataminer-app.yml @@ -22,7 +22,7 @@ tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms', 'dataminer_algorithms_script' ] - name: Cron job that updates the algorithms repository and adds the missing algorithms configurations - cron: name="SVN update the algorithms repository" minute="*/10" job="/usr/local/bin/algorithms-updater" user='{{ smartgears_user }}' state=present + cron: name="SVN update the algorithms repository" minute="*/10" job="/usr/local/bin/algorithms-updater > {{ smartgears_instance_path }}/wps_algorithms_install_log/algorithms_updater_cron.log 2>&1" user='{{ smartgears_user }}' state=present tags: [ 'tomcat', 'dataminer', 'wps', 'dataminer_algorithms' ] - name: Create a directory where to install the gebco_08.nc data file diff --git a/smartgears/dataminer_app/templates/algorithms-updater.j2 b/smartgears/dataminer_app/templates/algorithms-updater.j2 index a53aa5de..e0442262 100644 --- a/smartgears/dataminer_app/templates/algorithms-updater.j2 +++ b/smartgears/dataminer_app/templates/algorithms-updater.j2 @@ -36,7 +36,7 @@ function check_lock_file() { if [ -f $LOCK_FILE ] ; then set +o pipefail set +e - RUNNING_JOB=$( ps auwwx | grep `cat /tmp/io` | grep -v grep ) + RUNNING_JOB=$( ps auwwx | grep `cat $LOCK_FILE` | grep -v grep ) RUNNING_JOB_RETVAL=$? if [ $RUNNING_JOB_RETVAL -eq 0 ] ; then logger 'algorithms-updater: another job still running, exiting.'