/[slony-test]/adsl/test_difference.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /adsl/test_difference.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (show annotations)
Sun Feb 11 22:33:29 2007 UTC (15 years, 4 months ago) by dpavlin
File MIME type: application/x-sh
File size: 846 byte(s)
refresh master output also

1
2 #echo "** sync"
3 #slonik_execute_script -c 'select now();' 1 | slonik
4
5 op='=='
6 echo $0 $1 | grep 'diff' >/dev/null && op='!='
7
8 echo "name [$0 $1] op [$op]"
9
10 psql="sudo -u postgres psql adsl"
11 master="`$psql -p 5001 -c 'select * from po_mjesecima'`"
12 echo -e "## MASTER\n$master"
13 slave=''
14 oldslave=''
15 sleep=1
16 while [ ! "$master" $op "$slave" -o "$slave" == '' ] ; do
17 slave="`$psql -p 5002 -c 'select * from po_mjesecima'`"
18 if [ "$oldslave" != "$slave" ]
19 then
20 echo -e "$op SLAVE\n$slave"
21 else
22 #slonik_execute_script -c 'select now();' 1 | slonik
23 ( slonik_print_preamble ; echo 'sync(id=1);' ) | slonik
24 ( slonik_print_preamble ; echo 'sync(id=2);' ) | slonik
25 echo -n "."
26 sleep=`expr $sleep \* 2`
27 sleep $sleep
28 master="`$psql -p 5001 -c 'select * from po_mjesecima'`"
29 fi
30 oldslave="$slave"
31 done
32
33 echo "** OK -- master $op slave **"

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.26