backup

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupService

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

func NewCleanupService

func NewCleanupService(config *config.CleanupConfig, uploadConfig *config.UploadConfig, logger *logger.Logger) *CleanupService

func (*CleanupService) CleanupAgeBasedFiles

func (c *CleanupService) CleanupAgeBasedFiles(ctx context.Context, backupDir string, selectedDatabases []string) error

CleanupAgeBasedFiles removes old files based on age with cloud verification

func (*CleanupService) CleanupLocal

func (c *CleanupService) CleanupLocal(ctx context.Context, backupDir string) error

CleanupLocal is now deprecated in favor of the new smart cleanup system This function is kept for backward compatibility but should not be used

func (*CleanupService) GetConfig

func (c *CleanupService) GetConfig() *config.CleanupConfig

GetConfig returns the cleanup configuration

func (*CleanupService) GetOldFiles

func (c *CleanupService) GetOldFiles(backupDir string, retentionDays int) ([]string, error)

type Service

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

func NewService

func NewService(cfg *config.Config, log *logger.Logger) (*Service, error)

func (*Service) CleanupUploadedFiles

func (s *Service) CleanupUploadedFiles(ctx context.Context) error

CleanupUploadedFiles removes local files that have been successfully uploaded

func (*Service) GetStatistics

func (s *Service) GetStatistics() Statistics

func (*Service) GetUploadedFiles

func (s *Service) GetUploadedFiles() map[string]time.Time

GetUploadedFiles returns list of files that were successfully uploaded

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

type Statistics

type Statistics struct {
	TotalDatabases    int
	SuccessfulBackups int
	FailedBackups     int
	SuccessfulUploads int
	FailedUploads     int
	StartTime         time.Time
	EndTime           time.Time
}

Jump to

Keyboard shortcuts

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