rsync

package
v0.0.0-...-31509f8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRsyncSourcePath = errors.New("multiple remote source path passed")

ErrInvalidRsyncSourcePath is returned when there are multiple source path used to rsync from a remote source host

View Source
var Excludes = []string{
	"pg_hba.conf", "postmaster.opts", "postgresql.auto.conf", "internal.auto.conf",
	"gp_dbid", "postgresql.conf", "backup_label.old", "postmaster.pid", "recovery.conf",
}
View Source
var Options = []string{"--archive", "--compress", "--stats"}

Functions

func ResetRsyncCommand

func ResetRsyncCommand()

func Rsync

func Rsync(options ...Option) error

Rsync executes "rsync" on the system with the given options. The caller needs to consider adding "/" using os.PathSeparator to the source directory to control where in the destination directory the files go.

Any errors returned are of type RsyncError, which wraps the underlying error from "rsync" if called.

func SetRsyncCommand

func SetRsyncCommand(command exectest.Command)

XXX: for internal testing only

Types

type Option

type Option func(*optionList)

func WithDestination

func WithDestination(dst string) Option

func WithDestinationHost

func WithDestinationHost(host string) Option

func WithExcludedFiles

func WithExcludedFiles(files ...string) Option

func WithOptions

func WithOptions(opts ...string) Option

func WithSourceHost

func WithSourceHost(host string) Option

func WithSources

func WithSources(srcs ...string) Option

func WithStream

func WithStream(stream step.OutStreams) Option

type RsyncError

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

func (RsyncError) Error

func (e RsyncError) Error() string

func (RsyncError) Unwrap

func (e RsyncError) Unwrap() error

Jump to

Keyboard shortcuts

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