X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/4b7ce26629a9ab67bef9eb41513a5b08bd833cd9..c08a9e590d1ca6fd5d3539f1a50832dc3a1a60ef:/src/Snapshot.php?ds=sidebyside diff --git a/src/Snapshot.php b/src/Snapshot.php index b30def2..fa51be0 100644 --- a/src/Snapshot.php +++ b/src/Snapshot.php @@ -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).