Blame view

scripts/SyncManunjaFromCdpp3.sh 1.31 KB
e26771e0   Elena.Budnik   sync bases script...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

# run at manunja
# MISSIONS_LIST example
# ACE
# GRD/AE

export DDBASE=/data/DDBASE/DATA
export remote=cdpp3.irap.omp.eu
export DDLIB=/home/budnik/AMDANEW/DDLIB/lib
export DECODERTOOLS=/home/budnik/depotDECODER/TOOLS

MISSIONS=${DDBASE}/../MISSIONS_LIST_CDPP3

if [ -f ${MISSIONS} ]; then
    while read Mission 
    do
        # if empty line - continue
        [ -z "$Mission" ] && continue

        for Dir in $(find -L $DDBASE/$Mission*  -maxdepth 4 -type d -links 2) 
        do 
   
            remoteDir="${Dir/data/data1}"
0fef3cc8   Elena.Budnik   pwd...
25
26
27
28
29
            sshpass -p "xxx" rsync -auvr budnik@${remote}:${remoteDir}/*nc.gz ${Dir}
            sshpass -p "xxx" rsync -vu  budnik@${remote}:${remoteDir}/*times.nc ${Dir}
            sshpass -p "xxx" rsync -vu  budnik@${remote}:${remoteDir}/*info* ${Dir}
        #    sshpass -p "xxx" rsync -vu budnik@${remote}:${remoteDir}/Vesrion ${Dir} 
        #    sshpass -p "xxx" rsync -vu budnik@${remote}:${remoteDir}/*Stop ${Dir}
e26771e0   Elena.Budnik   sync bases script...
30
31
32
33
34
35
36
37
38
39
40
41
42

            cd ${Dir}          
            ls | xargs chown -R budnik:dd ${Dir}
            ls | xargs chmod -R ug+w ${Dir} 
            ./clean
            cd ${DDBASE}/..
            
            php ${DECODERTOOLS}/DataBaseLog/updateDataBaseLog.php ${Dir} budnik fromCDPP3

         #   echo ${Dir} `date +"%Y-%m-%d"` >> sync.log
        done
    done <${MISSIONS}
 fi