[pve-devel] [PATCH pve-docs 1/1] add pre/post-restore events to example hookscript

Stefan Hanreich s.hanreich at proxmox.com
Thu Nov 10 16:33:39 CET 2022


Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 examples/guest-example-hookscript.pl | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/examples/guest-example-hookscript.pl b/examples/guest-example-hookscript.pl
index adeed59..19fe213 100755
--- a/examples/guest-example-hookscript.pl
+++ b/examples/guest-example-hookscript.pl
@@ -54,6 +54,20 @@ if ($phase eq 'pre-start') {
 
     print "$vmid stopped. Doing cleanup.\n";
 
+} elsif ($phase eq 'pre-restore') {
+
+    # Phase 'pre-restore' will be executed before restoring a backup. (via UI or
+    # CLI)
+
+    print "Restoring $vmid from backup.\n";
+
+} elsif ($phase eq 'post-restore') {
+
+    # Phase 'pre-restore' will be after before restoring a backup. (via UI or
+    # CLI)
+
+    print "$vmid finished restoring from backup.\n";
+
 } else {
     die "got unknown phase '$phase'\n";
 }
-- 
2.30.2





More information about the pve-devel mailing list