source: subversion/sites/other/trapi/go.sh @ 31161

Last change on this file since 31161 was 20398, checked in by deelkar, 10 years ago

add so called "ugly hack" to support replicate diffs. By Milenko

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#/bin/bash
2
3# Directory you want the .osc files moved to
4changedir="/home/user/change/"
5# Osmosis --rii workingDirectory
6workdir="/home/user/work/"
7
8#Get initial sequence number
9
10OLDSEQUENCE=`grep sequenceNumber ${workdir}state.txt|cut -d= -f2`
11
12while true; do
13
14        ./osmosis --rri workingDirectory=$workdir --wxc "temp.osc.gz"
15
16        SEQUENCE=`grep sequenceNumber ${workdir}state.txt|cut -d= -f2`
17
18# Get the osmosis timestamp so we can add it to the filename so trpcs knows the timestamp to write after this changeset is applied to the db
19        STAMP=`grep timestamp ${workdir}state.txt|cut -d= -f2|cut -c1-4,6,7,9,10,12,13,16,17` 
20
21# Check to see if the sequence number is the same as the last run through the loop. 
22# If it is, that means there were no new replicate diffs to download.
23
24        if [ $OLDSEQUENCE != $SEQUENCE ] ; then
25                filename="${changedir}${OLDSEQUENCE}-${SEQUENCE}-${STAMP}.osc.gz"
26
27                mv "temp.osc.gz" $filename
28               
29                OLDSEQUENCE=$SEQUENCE   
30        else
31# If the sequence numbers match, then this .osc file contains no data, so delete it
32                rm "temp.osc.gz"
33        fi
34
35        sleep 120
36done
Note: See TracBrowser for help on using the repository browser.