19 |
|
|
20 |
my ($debug,$verbose) = (0,0); |
my ($debug,$verbose) = (0,0); |
21 |
my ($help,$masterhost,$masterport,$masteruser,$masterpassword); |
my ($help,$masterhost,$masterport,$masteruser,$masterpassword); |
|
my $snapshot = "__Snapshot"; |
|
22 |
|
|
23 |
my $result = GetOptions( |
my $result = GetOptions( |
24 |
"debug!" => \$debug, "verbose!" => \$verbose, "help" => \$help, |
"debug!" => \$debug, "verbose!" => \$verbose, "help" => \$help, |
25 |
"masterhost=s" => \$masterhost, "masterport=i" => \$masterport, |
"masterhost=s" => \$masterhost, "masterport=i" => \$masterport, |
26 |
"masteruser=s" => \$masteruser, "masterpassword=s" => \$masterpassword, |
"masteruser=s" => \$masteruser, "masterpassword=s" => \$masterpassword, |
|
"snapshot=s" => \$snapshot, |
|
27 |
); |
); |
28 |
|
|
29 |
if (defined($help) || (scalar(@ARGV) < 2) || ($ARGV[1] !~ /^\d+$/)) { |
if (defined($help) || (scalar(@ARGV) < 2) || ($ARGV[1] !~ /^\d+$/)) { |
31 |
Options: |
Options: |
32 |
--masterhost=hostname --masterport=port |
--masterhost=hostname --masterport=port |
33 |
--masteruser=username --masterpassword=string |
--masteruser=username --masterpassword=string |
|
--snapshot=snapshot |
|
34 |
"; |
"; |
35 |
exit ((scalar(@ARGV) < 2)? 1:0); |
exit ((scalar(@ARGV) < 2)? 1:0); |
36 |
} |
} |
37 |
|
|
38 |
|
$RServ::quiet = !$verbose; |
39 |
|
if ($debug) { |
40 |
|
$RServ::quiet = 0; |
41 |
|
no warnings 'vars'; |
42 |
|
$RServ::debug = $debug; |
43 |
|
} |
44 |
|
|
45 |
my $dbname = $ARGV[0]; |
my $dbname = $ARGV[0]; |
46 |
my $howold = $ARGV[1]; |
my $howold = $ARGV[1]; |
47 |
|
|
48 |
my $minfo = "dbname=$dbname"; |
my $minfo = MkInfo($dbname,$masterhost,$masterport,$masteruser,$masterpassword); |
|
$minfo = "$minfo host=$masterhost" if (defined($masterhost)); |
|
|
$minfo = "$minfo port=$masterport" if (defined($masterport)); |
|
|
$minfo = "$minfo user=$masteruser" if (defined($masteruser)); |
|
|
$minfo = "$minfo password=$masterpassword" if (defined($masterpassword)); |
|
49 |
|
|
50 |
print "Master connection is $minfo\n" if ($debug); |
print "Master connection is $minfo\n" if ($debug); |
51 |
|
|