]> git.datanom.net - omvzfs.git/commitdiff
Added methods to Snapshot for rollback and cloning.
authorNiclas Berglind <nb@kjam.se>
Mon, 14 Apr 2014 18:48:58 +0000 (20:48 +0200)
committerMichael Rasmussen <mir@datanom.net>
Thu, 17 Apr 2014 23:10:30 +0000 (01:10 +0200)
Signed-off-by: Niclas Berglind <nb@kjam.se>
src/Snapshot.php

index b30def21c05864a622e5ddb6aa6031c1ee3e68c6..fa51be0a63f35ba5ae1f60385e689f6507f6d91b 100644 (file)
@@ -159,6 +159,29 @@ class OMVModuleZFSSnapshot {
                $this->exec($cmd,$out,$res);
        }
 
+       /**
+        * Rollback a Snapshot on commandline.
+        *
+        * @return void
+        * @access public
+        */
+       public function rollback() {
+               $cmd = "zfs rollback " . $this->name . " 2>&1";
+               $this->exec($cmd,$out,$res);
+       }
+
+       /**
+        * Clones a Snapshot on commandline.
+        *
+        * @param string $newname
+        * @return void
+        * @access public
+        */
+       public function clonesnap($newname) {
+               $cmd = "zfs clone -p " . $this->name . " " . $newname . " 2>&1";
+               $this->exec($cmd,$out,$res);
+       }
+
        /**
         * Helper function to execute a command and throw an exception on error
         * (requires stderr redirected to stdout for proper exception message).
This page took 0.031052 seconds and 5 git commands to generate.