/[rserv]/bin/ApplySnapshot
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/ApplySnapshot

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

revision 1.2 by dpavlin, Tue Aug 5 09:20:08 2003 UTC revision 1.3 by dpavlin, Tue Aug 5 09:52:36 2003 UTC
# Line 14  use Getopt::Long; Line 14  use Getopt::Long;
14  $| = 1;  $| = 1;
15    
16  $result = GetOptions("debug!", "verbose!", "help",  $result = GetOptions("debug!", "verbose!", "help",
17                       "host=s", "user=s", "password=s");                       "host=s", "user=s", "password=s", "snapshot=s");
18    
19  my $debug = $opt_debug || 0;  my $debug = $opt_debug || 0;
20  my $verbose = $opt_verbose || 0;  my $verbose = $opt_verbose || 0;
21  my $snapshot = $opt_snapshot || "__Snapshot";  my $snapshot = $opt_snapshot || "__Snapshot";
22    
23  if (defined($opt_help) || (scalar(@ARGV) < 1)) {  if (defined($opt_help) || (scalar(@ARGV) < 1)) {
24      print "Usage: $0 --host=name --user=name --password=string slavedb\n";      print "Usage: $0 --host=name --user=name --password=string --snapshot=file slavedb\n";
25      exit ((scalar(@ARGV) < 1)? 1:0);      exit ((scalar(@ARGV) < 1)? 1:0);
26  }  }
27    
# Line 34  $sinfo = "$sinfo password=$opt_password" Line 34  $sinfo = "$sinfo password=$opt_password"
34    
35  my $conn = Pg::connectdb($sinfo);  my $conn = Pg::connectdb($sinfo);
36    
37  my $inpf = new IO::File;  my $inpf;
38  $inpf = STDIN;  if (defined($opt_snapshot)) {
39        $inpf = new IO::File;
40  $RServ::quiet = !$verbose;      $inpf->open("< $opt_snapshot");
41    } else {
42        $inpf = STDIN;
43    }
44    
45  $res = ApplySnapshot ($conn, $inpf);  $res = ApplySnapshot ($conn, $inpf);
46    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.26