]> git.proxmox.com Git - pve-manager.git/blobdiff - vzdump-hook-script.pl
api: nodes: add info about current boot mode
[pve-manager.git] / vzdump-hook-script.pl
index 60edbc0487b78aa96ffa7960fdcb300ccbe7f7d2..4d530cef47a558dbb1b05720748c8bad0872bfd5 100755 (executable)
@@ -11,11 +11,13 @@ print "HOOK: " . join (' ', @ARGV) . "\n";
 
 my $phase = shift;
 
-if ($phase eq 'job-start' ||
+if ($phase eq 'job-init' ||
+    $phase eq 'job-start' ||
     $phase eq 'job-end'  ||
     $phase eq 'job-abort') {
 
     # undef for Proxmox Backup Server storages
+    # undef in phase 'job-init' except when --dumpdir is used directly
     my $dumpdir = $ENV{DUMPDIR};
 
     # undef when --dumpdir is used directly
@@ -26,6 +28,14 @@ if ($phase eq 'job-start' ||
     print "storeid=$storeid;" if defined($storeid);
     print "\n";
 
+    # example: wake up remote storage node and enable storage
+    if ($phase eq 'job-init') {
+       #system("wakeonlan AA:BB:CC:DD:EE:FF");
+       #sleep(30);
+       #system ("/sbin/pvesm set $storeid --disable 0") == 0 ||
+       #    die "enabling storage $storeid failed";
+    }
+
     # do what you want
 
 } elsif ($phase eq 'backup-start' ||