X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/4b7ce26629a9ab67bef9eb41513a5b08bd833cd9..97e4887b3864cc11f131c51eb337e7bb4c025e27:/src/Snapshot.php 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).