]> oss.titaniummirror.com Git - ovzbpc.git/commitdiff
The velist file now goes into the log subdirectory and its name is derived
authorsmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Thu, 10 Jan 2008 22:59:07 +0000 (22:59 +0000)
committersmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Thu, 10 Jan 2008 22:59:07 +0000 (22:59 +0000)
from the script's basename.

BackupPC_ovz

index 7106749f84d61f152bf5bb7495233f60028366cb..830de2cc98bb50d671b783d2d69d4d477911a970 100755 (executable)
@@ -22,6 +22,7 @@ my @velist = ();
 my $pidfile = "/tmp/".basename($0).".pid";
 my $vzsnap = 'vzsnap'; # Mount point and lv names.  Mount is relative to /.
 my $snapsize = '1g';
+my $velistFile = $ENV{HOME}."/log/".basename($0).".velist";
 
 sub cmdExecOrEval
 {
@@ -67,8 +68,7 @@ sub refreshConfig()
 {
   # Write the VEs on all HNs to a config file on the BackupPC server for
   # later use.
-  open my $out, ">/etc/backuppc/vzlist_bpc" ||
-      die "Cannot write to /etc/backuppc/vzlist_bpc";
+  open my $out, ">$velistFile" || die "Cannot write to $velistFile";
   foreach my $hn (@HNS) {
     open my $fh, "ssh -l root $hn vzlist -a |" ||
        die "Can run remote vzlist command";
@@ -100,8 +100,8 @@ sub refreshConfig()
 # For use on the BackupPC server.
 sub loadVeList()
 {
-  open my $fh, "</etc/backuppc/vzlist_bpc" ||
-      die "Cannot read from /etc/backuppc/vzlist_bpc. Set a preuser script.";
+  open my $fh, "<$velistFile" ||
+      die "Cannot read from $velistFile. Set a preuser script.";
 
   while (<$fh>) {
     chomp;