backup

package
v1.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBackupFilename

func GetBackupFilename(timestamp time.Time) string

GetBackupFilename returns generated filename

func GetBackupMedia

func GetBackupMedia() map[string]string

GetBackupMedia returns backup media path

func MakeBackup

func MakeBackup(backupPath string) error

MakeBackup creates virtual maching backup to path

Types

type BlockDevice added in v1.11.2

type BlockDevice struct {
	Name       string        `json:"name"`
	FileSystem string        `json:"fstype"`
	MountPoint string        `json:"mountpoint"`
	Vendor     string        `json:"vendor"`
	Model      string        `json:"model"`
	HotPlug    interface{}   `json:"hotplug"`
	Children   []BlockDevice `json:"children"`
}

BlockDevice represents a single block device entry in the JSON output of an lsblk -J command.

func (*BlockDevice) IsRemovable added in v1.11.2

func (bd *BlockDevice) IsRemovable() bool

IsRemovable returns true if the block device is a removable device (e.g. a USB drive) and false otherwise.

type LsblkOutput added in v1.11.2

type LsblkOutput struct {
	BlockDevices []BlockDevice `json:"blockdevices"`
}

LsblkOutput represents the parsed JSON output of an lsblk -J command.

func ListBlockDevices added in v1.11.2

func ListBlockDevices() (*LsblkOutput, error)

ListBlockDevices generates a listing of the available block devices using lsblk. Usable only on Linux hosts.

func ParseLsblkJSON added in v1.11.2

func ParseLsblkJSON(lsblkJSON string) (*LsblkOutput, error)

ParseLsblkJSON parses JSON output from an lsblk -J command.

func (*LsblkOutput) GetRemovableDisks added in v1.11.2

func (blk *LsblkOutput) GetRemovableDisks() map[string]string

GetRemovableDisks processes lsblk output to return a listing of connected removable devices. The return value is a map from mount points to block device names.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL