X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=BackupPC_ovz;h=bb4b100dc00322e8bf51b28e616119bcbb65a277;hb=2289d8cb0089b72802c6a39cdce181d57cf239a8;hp=5b7d010dd19e7b9572c3635b5d7e369bef7ed433;hpb=550b47b0118b8a2344e975082bbf6d81d8dde040;p=ovzbpc.git diff --git a/BackupPC_ovz b/BackupPC_ovz index 5b7d010..bb4b100 100755 --- a/BackupPC_ovz +++ b/BackupPC_ovz @@ -4,6 +4,8 @@ # # OpenVZ integration for BackupPC allowing the latter to backup OpenVZ VE's # with ovz awareness to improve backup and restore efficiency and features. +# +# 20080605 0.1 Initial release # FIXME: signal handling to clean up mount point and snapshot on termination @@ -15,12 +17,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 +69,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 |" ||