backup

package
v0.0.0-...-1f186d8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

CopyFile is the most basic copy function, copying a file from src to dst

func SelectMacFolder

func SelectMacFolder(printout string) string

SelectMacFolder prompts user to select a folder with a GUI

Types

type Backup

type Backup struct {
	Unix       bool
	Paranoid   bool
	FolderMode bool

	FD string

	Identifier string

	Source      Disk
	Destination Disk
	AllDisks    []Disk

	SelectedUsers []User
	AllUsers      []User

	MainLog *log.Logger
	FileLog *log.Logger
	ErrLog  *log.Logger
	EndLog  *log.Logger
	// contains filtered or unexported fields
}

Backup holds lots of pertanant information for a backup process

func NewBackup

func NewBackup() (temp Backup)

NewBackup returns a Backup, testing sudo, setting fd, and setting OS

func (*Backup) GetUsers

func (b *Backup) GetUsers()

GetUsers sets up the users available for a backup

func (*Backup) GoBackup

func (b *Backup) GoBackup()

GoBackup is the actual backup function

func (*Backup) SetLog

func (b *Backup) SetLog()

SetLog sets up the log files for the program

func (*Backup) SetSudo

func (b *Backup) SetSudo()

SetSudo verifies admin access on a mac

func (*Backup) VerifySizes

func (b *Backup) VerifySizes()

VerifySizes checks and shows the technician the final sizes of the selected users/folder

type Disk

type Disk struct {
	Usage *du.DiskUsage

	RootFiles   []RootFile
	RootFolders []RootFolder

	AbsPath string
	Name    string
}

Disk holds a lot of information for disk paths, such as "C:\\" or "/Volumes/Macintosh\ HD/"

func GetDrives

func GetDrives() (r []Disk)

GetDrives gets a list of available mounted disks on a Windows machine, in the [letter]:\ type

func GetInformation

func GetInformation(src string) (drive Disk)

GetInformation gets info on disks on a windows machine and appends useful information

func GetVolumes

func GetVolumes() (r []Disk)

GetVolumes gets a list of available mounted disks/partitions on a mac, in the /Volumes/ folder

func RemoveDisk

func RemoveDisk(slice []Disk, s int) []Disk

RemoveDisk removes a disk entry from a list

type RootFile

type RootFile struct {
	Size uint64

	Percentage float32

	AbsPath string
	Name    string
}

RootFile holds information for files on a root of a directory, mainly user root files

type RootFolder

type RootFolder struct {
	Size uint64

	Percentage float32

	AbsPath string
	Name    string
}

RootFolder holds a lot of information for each root folder found in a user's directory

type User

type User struct {
	Size uint64

	AllFiles   []RootFile
	AllFolders []RootFolder

	AbsPath string
	Name    string
}

User holds pertanant information for each user in a OS

Jump to

Keyboard shortcuts

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