Skip to content
Snippets Groups Projects
run_dps.sh 745 B
Newer Older
#!/bin/bash
# set -euxo pipefail
set -eo pipefail
ranchodeluxe's avatar
ranchodeluxe committed
export TZ="Etc/UTC"
mkdir output
basedir=$( cd "$(dirname "$0")"; pwd -P )
echo "Basedir: $basedir"
echo "Initial working directory: $(pwd -P)"
echo "conda: $(which conda)"
echo "Python: $(which python)"
python --version
ranchodeluxe's avatar
ranchodeluxe committed
source activate /opt/conda/envs/env-feds-dask
echo "Starting algorithm in subshell"
(
pushd "$basedir"
{ # try
  echo "Running in directory: $(pwd -P)"
  python FireRun.py $1
  popd
  echo "Copying log to special output dir"
  cp "$basedir/running.log" ./output
  #cp "$basedir/dask-report.html" ./output
gsfc_landslides's avatar
gsfc_landslides committed

} || { # catch
  popd
  echo "Copying log to special output dir"
  cp "$basedir/running.log" ./output
  #cp "$basedir/dask-report.html" ./output
echo "Done!"

exit