generate_symlinks.sh 771 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #! /bin/bash
  2. if [ -z "$1" ]
  3. then
  4. echo "No argument supplied"
  5. echo "Need to specify orval you want to use (in /scratch folder)"
  6. exit 1
  7. fi
  8. if [ -z "$2" ]
  9. then
  10. echo "No argument supplied"
  11. echo "Need to specify where you want to store data"
  12. exit 1
  13. fi
  14. echo "Creating links into /scratch folder"
  15. scratch="/scratch"
  16. orval=$1
  17. path=$2
  18. for link in {"data","results","saved_models","models_info","models_backup","threshold_map","learned_zones","custom_norm"}; do
  19. if [ -L ${link} ]; then
  20. rm ${link}
  21. fi
  22. fullpath=${scratch}/${orval}/${path}/${link}
  23. if [ ! -d "${fullpath}" ]; then
  24. mkdir -p ${fullpath}
  25. fi
  26. # remove `orval` name for running part
  27. ln -s ${scratch}/${path}/${link} ${link}
  28. done