]> oss.titaniummirror.com Git - ovzbpc.git/commitdiff
BackupPC_ovz now gets its list of HNs from /etc/backuppc/BackupPC_ovz.hnlist.
authorsmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Fri, 11 Jan 2008 01:08:24 +0000 (01:08 +0000)
committersmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Fri, 11 Jan 2008 01:08:24 +0000 (01:08 +0000)
BackupPC_ovz

index 5b7d010dd19e7b9572c3635b5d7e369bef7ed433..883b693723273fc789a15fc99245851e4f635121 100755 (executable)
@@ -15,12 +15,12 @@ use File::Path;
 use Proc::PID::File;
 
 # Various constants
-my @HNS = ('pe18001.titaniummirror.com', 'pe18002.titaniummirror.com');
 my @script_ext = qw(start stop mount umount);
 my @velist = ();
 my $pidfile = "/tmp/".basename($0).".pid";
 my $vzsnap = 'vzsnap'; # Mount point and lv names.  Mount is relative to /.
 my $snapsize = '1g';
+my $hnlistFile = "/etc/backuppc/".basename($0).".hnlist";
 my $velistFile = $ENV{HOME}."/log/".basename($0).".velist";
 
 sub cmdExecOrEval
@@ -67,6 +67,15 @@ sub refreshConfig()
 {
   # Write the VEs on all HNs to a config file on the BackupPC server for
   # later use.
+  my @HNS = ();
+  open my $cfg, "<$hnlistFile" || die "Cannot read $hnlistFile";
+  while (<$cfg>) {
+    chomp;
+    push(@HNS, split(' ')) if (! /^#/);
+  }
+  close($cfg);
+  die "No HNs defined in $hnlistFile" if ($#HNS < 0);
+
   open my $out, ">$velistFile" || die "Cannot write to $velistFile";
   foreach my $hn (@HNS) {
     open my $fh, "ssh -l root $hn vzlist -a |" ||