backup

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package backup manages the backup creation process

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command represents a pgbackrest backup command

func NewBackupCommand

func NewBackupCommand(
	configuration *pgbackrestApi.PgbackrestConfiguration,
	backupConfig *cnpgApiV1.BackupPluginConfiguration,
	pgDataDirectory string,
) *Command

NewBackupCommand creates a new pgbackrest backup command

func (*Command) CreatePgbackrestStanza

func (b *Command) CreatePgbackrestStanza(ctx context.Context, stanza string, env []string) error

CreatePgbackrestStanza ensures that the destinationArchive is ready to perform archiving. It's safe to re-run pgbackrest stanza-create on an existing archive, command will fail if another database was used to create it.

func (*Command) GetDataConfiguration

func (b *Command) GetDataConfiguration(
	options []string,
) ([]string, error)

GetDataConfiguration gets the configuration in the `Data` object of the pgbackrest configuration

func (*Command) GetExecutedBackupInfo

func (b *Command) GetExecutedBackupInfo(
	ctx context.Context,
	backupName string,
	stanza string,
	env []string,
) (*pgbackrestCatalog.Catalog, error)

GetExecutedBackupInfo get the status information about the executed backup

func (*Command) GetPgbackrestBackupOptions

func (b *Command) GetPgbackrestBackupOptions(
	ctx context.Context,
	backupName string,
	stanza string,
) ([]string, error)

GetPgbackrestBackupOptions extract the list of command line options to be used with pgbackrest backup

func (*Command) IsCompatible

func (b *Command) IsCompatible(postgresVers semver.Version) error

IsCompatible checks if pgbackrest can back up this version of PostgreSQL

func (*Command) Take

func (b *Command) Take(
	ctx context.Context,
	backupName string,
	stanza string,
	env []string,
	backupTemporaryDirectory string,
) error

Take takes a backup

Jump to

Keyboard shortcuts

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