backup

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BackupDir is the directory where backups are stored on the server
	BackupDir = "/var/lib/tako/backups"

	// DefaultRetention is the default number of days to keep backups
	DefaultRetention = 7
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupInfo

type BackupInfo struct {
	ID          string    `json:"id"`
	Service     string    `json:"service"`
	Volume      string    `json:"volume"`
	Size        int64     `json:"size"`
	CreatedAt   time.Time `json:"created_at"`
	Path        string    `json:"path"`
	Compression string    `json:"compression"`
}

BackupInfo contains metadata about a backup

type Manager

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

Manager handles volume backup and restore operations

func NewManager

func NewManager(client *ssh.Client, projectName, environment string, verbose bool) *Manager

NewManager creates a new backup manager

func (*Manager) BackupAllVolumes

func (m *Manager) BackupAllVolumes(cfg *config.Config) ([]BackupInfo, error)

BackupAllVolumes backs up all volumes for the project

func (*Manager) BackupVolume

func (m *Manager) BackupVolume(volumeName string) (*BackupInfo, error)

BackupVolume creates a backup of a Docker volume

func (*Manager) CleanupOldBackups

func (m *Manager) CleanupOldBackups(retentionDays int) (int, error)

CleanupOldBackups removes backups older than retention days

func (*Manager) DeleteBackup

func (m *Manager) DeleteBackup(volumeName, backupID string) error

DeleteBackup deletes a specific backup

func (*Manager) ListBackups

func (m *Manager) ListBackups(volumeName string) ([]BackupInfo, error)

ListBackups lists all backups for a volume or all volumes

func (*Manager) RestoreVolume

func (m *Manager) RestoreVolume(volumeName, backupID string) error

RestoreVolume restores a volume from a backup

func (*Manager) ScheduleBackup

func (m *Manager) ScheduleBackup(schedule string, volumeName string) error

ScheduleBackup creates a cron job for scheduled backups

Jump to

Keyboard shortcuts

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