backup

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileNameTimeLayout = "15-04_02-01-2006" // The format of the file timestamp for the Go time package formatter
)

Variables

This section is empty.

Functions

func FileTime

func FileTime(name string) (time.Time, error)

FileTime returns the time.Time the backup was taken, given the file name.

func Restore

func Restore(zr *zip.Reader, containerID string, dc client.ContainerAPIClient) error

Restore reads from the given zip.ReadCloser, copying each of the files to the directory containing the server files.

func RestoreMCWorld

func RestoreMCWorld(zr *zip.Reader, containerID string, dc client.ContainerAPIClient) error

RestoreMCWorld reads from the given zip.Reader, copying each of the files to the default world directory.

func SaveHoldQuery

func SaveHoldQuery(command io.Writer, logs *bufio.Reader) ([]string, error)

SaveHoldQuery runs the `save hold` bedrock server command. It then repeatedly runs the `save query` command. When the server is ready for world files to be copied, a list of suggested files to back up is returned. SaveResume must be run after SaveHoldQuery.

func SaveResume

func SaveResume(command io.Writer, logs *bufio.Reader) error

SaveResume runs the `save resume` bedrock server command and validates the successful response. It must be run after after every call to SaveHoldQuery.

func SortFilesByDate

func SortFilesByDate(files []os.FileInfo) []os.FileInfo

SortFilesByDate returns a list of all os.FileInfo with valid backup names, sorted by the date the backup was taken. The sort order is older files have lower indices.

Types

This section is empty.

Jump to

Keyboard shortcuts

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