Exemplo n.º 1
0
func execSubvolumeSnapshot(src string, dest string, readOnly bool) (retErr error) {
	defer func() {
		protolog.Info(&SubvolumeSnapshot{src, dest, readOnly, errorToString(retErr)})
	}()
	if readOnly {
		return executil.Run("btrfs", "subvolume", "snapshot", "-r", src, dest)
	}
	return executil.Run("btrfs", "subvolume", "snapshot", src, dest)
}
Exemplo n.º 2
0
func execSubvolumeExists(path string) (result bool) {
	defer func() {
		protolog.Debug(&SubvolumeExists{path, result})
	}()
	if err := executil.Run("btrfs", "subvolume", "show", path); err != nil {
		return false
	}
	return true
}
Exemplo n.º 3
0
func execSubvolumeDelete(path string) (retErr error) {
	defer func() {
		protolog.Debug(&SubvolumeDelete{path, errorToString(retErr)})
	}()
	return executil.Run("btrfs", "subvolume", "delete", path)
}