#!/bin/bash # Get job params given_hash=$(grep 'file_hash: *' $(dirname $0)/job.yml | tail -n1 | cut -c 14-) event_path=$(grep 'event_path: *' $(dirname $0)/job.yml | tail -n1 | cut -c 15-) echo event_path: $event_path echo given_hash: $given_hash # Check hash of input file to avoid race conditions actual_hash=$(sha256sum $event_path | cut -c -64) echo actual_hash: $actual_hash if [ "$given_hash" != "$actual_hash" ]; then echo Job was skipped as triggering file has been modified since scheduling exit 134 fi # Call actual job script python3 job_queue/job_FQQUQMTGtqUw/recipe.py >>job_queue/job_FQQUQMTGtqUw/output.log 2>&1 exit $?