SyncManunjaFromCdpp3.sh
1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/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}"
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}
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