store.ksh 966 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #! /usr/bin/ksh
  2. #set -e
  3. if [[ ($# -lt 2) || ($# -gt 3) ]]; then
  4. print "$0 requires two or three arguments: "
  5. print " #1: OUTPUT-DIR of the run"
  6. print " #2: SUB-DIRECTORY at ECFS (will be created below ec:/${USER})"
  7. print " #3: (optional) RESTART DIR"
  8. print ""
  9. print " To use this script, set in your rc file:"
  10. print ""
  11. print " output.user.scripts.condition : True"
  12. print " output.user.scripts : <bindir>/store.ksh ${output.dir} TM5/bench/exp ${restart.write.dir}"
  13. print ""
  14. print " This would archive output in your ec:~/TM5/bench/exp/. Change as fit."
  15. exit 1
  16. fi
  17. # Backup output
  18. emkdir -p ec:/${USER}/$2 || true
  19. emv -po $1/TM5* ec:/${USER}/$2/
  20. emv -po $1/budget* ec:/${USER}/$2/
  21. emv -po $1/mmix* ec:/${USER}/$2/
  22. emv -po $1/j_statistics* ec:/${USER}/$2/
  23. # Backup restart files
  24. if [[ $# -eq 3 ]]; then
  25. emkdir -p ec:/${USER}/$2/restart || true
  26. ecp -p -t $3/* ec:/${USER}/$2/restart/
  27. fi
  28. exit 0