Commit e26771e0d663f3e17f5ec79f9fd352a22b702aeb

Authored by Elena.Budnik
1 parent cb4b7775

sync bases script example

Showing 1 changed file with 42 additions and 0 deletions   Show diff stats
scripts/SyncManunjaFromCdpp3.sh 0 → 100755
... ... @@ -0,0 +1,42 @@
  1 +#!/bin/sh
  2 +
  3 +# run at manunja
  4 +# MISSIONS_LIST example
  5 +# ACE
  6 +# GRD/AE
  7 +
  8 +export DDBASE=/data/DDBASE/DATA
  9 +export remote=cdpp3.irap.omp.eu
  10 +export DDLIB=/home/budnik/AMDANEW/DDLIB/lib
  11 +export DECODERTOOLS=/home/budnik/depotDECODER/TOOLS
  12 +
  13 +MISSIONS=${DDBASE}/../MISSIONS_LIST_CDPP3
  14 +
  15 +if [ -f ${MISSIONS} ]; then
  16 + while read Mission
  17 + do
  18 + # if empty line - continue
  19 + [ -z "$Mission" ] && continue
  20 +
  21 + for Dir in $(find -L $DDBASE/$Mission* -maxdepth 4 -type d -links 2)
  22 + do
  23 +
  24 + remoteDir="${Dir/data/data1}"
  25 + sshpass -p "Sacre-Cour" rsync -auvr budnik@${remote}:${remoteDir}/*nc.gz ${Dir}
  26 + sshpass -p "Sacre-Cour" rsync -vu budnik@${remote}:${remoteDir}/*times.nc ${Dir}
  27 + sshpass -p "Sacre-Cour" rsync -vu budnik@${remote}:${remoteDir}/*info* ${Dir}
  28 + # sshpass -p "Sacre-Cour" rsync -vu budnik@${remote}:${remoteDir}/Vesrion ${Dir}
  29 + # sshpass -p "Sacre-Cour" rsync -vu budnik@${remote}:${remoteDir}/*Stop ${Dir}
  30 +
  31 + cd ${Dir}
  32 + ls | xargs chown -R budnik:dd ${Dir}
  33 + ls | xargs chmod -R ug+w ${Dir}
  34 + ./clean
  35 + cd ${DDBASE}/..
  36 +
  37 + php ${DECODERTOOLS}/DataBaseLog/updateDataBaseLog.php ${Dir} budnik fromCDPP3
  38 +
  39 + # echo ${Dir} `date +"%Y-%m-%d"` >> sync.log
  40 + done
  41 + done <${MISSIONS}
  42 + fi
... ...