12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #!/bin/bash
- #
- # nohup ./update_nudging.sh ithaca atmos T255L91 b0ir FALSE >& update.log &
- # nohup ./update_nudging.sh ithaca ocean glorys2v1 ORCA025L46 fc0 >& update.log &
- #
- set -xuve
- date
- src=/esnas/releases/nudging
- plt=$1
- typ=$2
- grd=$3
- ver=$4
- set +e; mem=$5; set -e
- case $plt in
- ithaca) dst=/share/data/cfu/nudging ;;
- mn-*) dst=/gpfs/projects/bsc32/repository/nudging ;;
- ecmwf) dst=ec:/c3m/nudging ;;
- ht-*) dst=/work/pr1u1011/pr1u1011/pr1e1001/nudging ;;
- lindgren) dst=/cfs/klemming/nobackup/a/asifsami/nudging ;;
- jaguar) dst= ;;
- ar-*) dst=/work/pr1u1011/pr1u1011/shared/nudging ;;
- esac
- case $typ in
- ocean)
- if [[ $plt != ecmwf ]]; then
- ssh $plt mkdir -p $dst/$typ/$grd/$ver/$mem
- rsync -acrv $src/$typ/$grd/$ver/$mem ${plt}:${dst}/$typ/$grd/$ver
- else
- set +e
- ecaccess-file-mkdir $dst
- ecaccess-file-mkdir $dst/$typ
- ecaccess-file-mkdir $dst/$typ/$grd
- ecaccess-file-mkdir $dst/$typ/$grd/$ver
- ecaccess-file-mkdir $dst/$typ/$grd/$ver/$mem
- set -e
- list=/tmp/${ver}-${grd}-${mem}
- if [[ ! -a $list ]]; then
- ls -1 $src/$typ/$grd/$ver/$mem > $list
- fi
- for l in $(cat $list); do
- ecaccess-file-put $src/$typ/$grd/$ver/$mem/$l $dst/$typ/$grd/$ver/$mem/$l
- cat $list | sed -e '1d' > ${list}.tmp
- mv ${list}.tmp $list
- done
- cat $list; rm $list
- fi
- ;;
- atmos)
- if [[ $plt != ecmwf ]]; then
- ssh $plt mkdir -p $dst/$typ/$grd
- rsync -acrv $src/$typ/$grd/$ver ${plt}:${dst}/$typ/$grd
- else
- set +e
- ecaccess-file-mkdir $dst/$typ
- ecaccess-file-mkdir $dst/$typ/$grd
- ecaccess-file-mkdir $dst/$typ/$grd/$ver
- set -e
- list=/tmp/${typ}-${grd}-${ver}
- if [[ ! -a $list ]]; then
- ls -1 $src/$typ/$grd/$ver > $list
- fi
- for l in $(cat $list); do
- ecaccess-file-put $src/$typ/$grd/$ver/$l $dst/$typ/$grd/$ver/$l
- cat $list | sed -e '1d' > ${list}.tmp
- mv ${list}.tmp $list
- done
- cat $list; rm $list
- fi
- ;;
- esac
- date
|