restic

package
v1.10.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: Apache-2.0 Imports: 17 Imported by: 34

Documentation

Index

Constants

View Source
const (

	// DefaultMaintenanceFrequency is the default time interval
	// at which restic prune is run.
	DefaultMaintenanceFrequency = 7 * 24 * time.Hour
)

Variables

This section is empty.

Functions

func CmdEnv added in v1.6.0

func CmdEnv(backupLocation *velerov1api.BackupStorageLocation, credentialFileStore credentials.FileStore) ([]string, error)

CmdEnv returns a list of environment variables (in the format var=val) that should be used when running a restic command for a particular backend provider. This list is the current environment, plus any provider-specific variables restic needs.

func GetInsecureSkipTLSVerifyFromBSL added in v1.9.0

func GetInsecureSkipTLSVerifyFromBSL(backupLocation *velerov1api.BackupStorageLocation, logger logrus.FieldLogger) string

GetInsecureSkipTLSVerifyFromBSL get insecureSkipTLSVerify flag from BSL configuration, Then return --insecure-tls flag with boolean value as result.

func GetSnapshotID

func GetSnapshotID(snapshotIdCmd *Command) (string, error)

GetSnapshotID runs provided 'restic snapshots' command to get the ID of a snapshot and an error if a unique snapshot cannot be identified.

func RunBackup added in v1.2.0

func RunBackup(backupCmd *Command, log logrus.FieldLogger, updater uploader.ProgressUpdater) (string, string, error)

RunBackup runs a `restic backup` command and watches the output to provide progress updates to the caller.

func RunRestore added in v1.2.0

func RunRestore(restoreCmd *Command, log logrus.FieldLogger, updater uploader.ProgressUpdater) (string, string, error)

RunRestore runs a `restic restore` command and monitors the volume size to provide progress updates to the caller.

func TempCACertFile added in v1.4.0

func TempCACertFile(caCert []byte, bsl string, fs filesystem.Interface) (string, error)

TempCACertFile creates a temp file containing a CA bundle and returns its path. The caller should generally call os.Remove() to remove the file when done with it.

Types

type Command

type Command struct {
	Command        string
	RepoIdentifier string
	PasswordFile   string
	CACertFile     string
	Dir            string
	Args           []string
	ExtraFlags     []string
	Env            []string
}

Command represents a restic command.

func BackupCommand

func BackupCommand(repoIdentifier, passwordFile, path string, tags map[string]string) *Command

BackupCommand returns a Command for running a restic backup.

func ForgetCommand

func ForgetCommand(repoIdentifier, snapshotID string) *Command

func GetSnapshotCommand

func GetSnapshotCommand(repoIdentifier, passwordFile string, tags map[string]string) *Command

GetSnapshotCommand returns a Command for running a restic (get) snapshots.

func InitCommand

func InitCommand(repoIdentifier string) *Command

func PruneCommand

func PruneCommand(repoIdentifier string) *Command

func RestoreCommand

func RestoreCommand(repoIdentifier, passwordFile, snapshotID, target string) *Command

RestoreCommand returns a Command for running a restic restore.

func SnapshotsCommand added in v1.0.0

func SnapshotsCommand(repoIdentifier string) *Command

func StatsCommand added in v0.10.2

func StatsCommand(repoIdentifier, passwordFile, snapshotID string) *Command

func UnlockCommand added in v1.0.1

func UnlockCommand(repoIdentifier string) *Command

func (*Command) Cmd

func (c *Command) Cmd() *exec.Cmd

Cmd returns an exec.Cmd for the command.

func (*Command) RepoName

func (c *Command) RepoName() string

func (*Command) String

func (c *Command) String() string

String returns the command as a string.

func (*Command) StringSlice

func (c *Command) StringSlice() []string

StringSlice returns the command as a slice of strings.

Jump to

Keyboard shortcuts

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