/[rserv]/bin/Replicate
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /bin/Replicate

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by dpavlin, Sun Aug 10 13:51:54 2003 UTC revision 1.10 by dpavlin, Mon Oct 27 00:07:37 2003 UTC
# Line 54  if ($debug) { Line 54  if ($debug) {
54    
55  my $master = $ARGV[0] || "master";  my $master = $ARGV[0] || "master";
56  my $slave = $ARGV[1] || "slave";  my $slave = $ARGV[1] || "slave";
57    my $tables = $#ARGV < 2 ? undef : { map {($_, undef)} @ARGV[2..$#ARGV] };
58    
59  # first, let's check if a instance is alrealy running  # first, let's check if a instance is alrealy running
60    
# Line 134  SyncSync($mconn, $sconn); Line 135  SyncSync($mconn, $sconn);
135  my $outf = new IO::File;  my $outf = new IO::File;
136  open $outf, ">$snapshot";  open $outf, ">$snapshot";
137  print "\n>>>>>>>>>>>>> Prepare Snapshot\n\n" if ($verbose);  print "\n>>>>>>>>>>>>> Prepare Snapshot\n\n" if ($verbose);
138  my $res = PrepareSnapshot($mconn, $sconn, $outf, $slaveId);  my $res = PrepareSnapshot($mconn, $sconn, $outf, $slaveId, $tables);
139  close $outf;  close $outf;
140  if ($res < 0) {  if ($res < 0) {
141      unlink $fname;      unlink $fname;
# Line 151  if ($res == 0) Line 152  if ($res == 0)
152  my $inpf = new IO::File;  my $inpf = new IO::File;
153  open $inpf, "<$snapshot";  open $inpf, "<$snapshot";
154  print "\n>>>>>>>>>>>>> Apply Snapshot\n\n" if ($verbose);  print "\n>>>>>>>>>>>>> Apply Snapshot\n\n" if ($verbose);
155  $res = ApplySnapshot($sconn, $inpf);  $res = ApplySnapshot($sconn, $inpf, $tables);
156  close $inpf;  close $inpf;
157  if ($res < 0) {  if ($res < 0) {
158      unlink $fname;      unlink $fname;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.26