update_perturb.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. #
  3. # nohup ./update_perturb.sh ithaca atmos T255L91 e00l >& update.log &
  4. #
  5. set -xuve
  6. date
  7. src=/esnas/releases/perturb
  8. plt=$1
  9. typ=$2
  10. grd=$3
  11. ver=$4
  12. case $plt in
  13. ithaca) dst=/share/data/cfu/perturb ;;
  14. mn-*) dst=/gpfs/scratch/ecm86/ecm86010/perturb ;;
  15. ecmwf) dst=ec:/c3m/perturb ;;
  16. ht-*) dst=/work/pr1u1011/pr1u1011/pr1e1001/perturb ;;
  17. lindgren) dst=/cfs/klemming/nobackup/a/asifsami/perturb ;;
  18. jaguar) dst= ;;
  19. ar-*) dst=/work/pr1u1011/pr1u1011/shared/perturb ;;
  20. esac
  21. if [[ $plt != ecmwf ]]; then
  22. ssh $plt mkdir -p $dst/$typ/$grd
  23. rsync -acrv $src/$typ/$grd/$ver ${plt}:${dst}/$typ/$grd
  24. else
  25. set +e
  26. ecaccess-file-mkdir $dst/$typ
  27. ecaccess-file-mkdir $dst/$typ/$grd
  28. ecaccess-file-mkdir $dst/$typ/$grd/$ver
  29. set -e
  30. list=/tmp/${typ}-${grd}-${ver}
  31. if [[ ! -a $list ]]; then
  32. ls -1 $src/$typ/$grd/$ver > $list
  33. fi
  34. for l in $(cat $list); do
  35. ecaccess-file-put $src/$typ/$grd/$ver/$l $dst/$typ/$grd/$ver/$l
  36. cat $list | sed -e '1d' > ${list}.tmp
  37. mv ${list}.tmp $list
  38. done
  39. cat $list; rm $list
  40. fi
  41. date