backups

package
v0.21.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBackupRoute

func AddBackupRoute(w http.ResponseWriter, req *http.Request)

func CheckRepository

func CheckRepository(repository, password string) error

CheckRepository verifies if a repository exists and is valid

func CreateBackupJob

func CreateBackupJob(config BackupConfig, crontab string)

CreateBackupJob creates a backup job configuration

func CreateForgetJob

func CreateForgetJob(config BackupConfig, crontab string)

func CreateRepository

func CreateRepository(repository, password string) error

CreateRepository initializes a new Restic repository

func CreateRestoreJob

func CreateRestoreJob(config RestoreConfig)

CreateRestoreJob creates a restore job configuration

func DeleteByTag

func DeleteByTag(repository string, password string, tag string) error

func DeleteRepository

func DeleteRepository(repository string) error

DeleteRepository removes a Restic repository

func EditBackupRoute

func EditBackupRoute(w http.ResponseWriter, req *http.Request)

func EditRepositoryPassword

func EditRepositoryPassword(repository, currentPassword, newPassword string) error

EditRepositoryPassword changes the password of an existing repository

func ExecRestic

func ExecRestic(args []string, env []string) (string, error)

ExecRestic executes a restic command with the given arguments and environment variables. If the command fails due to a stale repository lock (older than 1 month), it automatically unlocks and retries. For newer locks, the error is returned as-is so the user can decide whether to unlock manually.

func ForgetSnapshot

func ForgetSnapshot(repository, password, snapshot string) error

func ForgetSnapshotRoute

func ForgetSnapshotRoute(w http.ResponseWriter, req *http.Request)

func InitBackups

func InitBackups()

func ListDirectory

func ListDirectory(repository, password, snapshotID, path string) (string, error)

ListDirectory lists the contents of a directory in a specific snapshot

func ListDirectoryWithFilters

func ListDirectoryWithFilters(repository, password, snapshotID, path string, recursive bool, longFormat bool) (string, error)

ListDirectoryWithFilters lists directory contents with additional filters

func ListFoldersRoute

func ListFoldersRoute(w http.ResponseWriter, req *http.Request)

func ListRepos

func ListRepos(w http.ResponseWriter, req *http.Request)

func ListSnapshots

func ListSnapshots(repository, password string) (string, error)

ListSnapshots returns a list of all snapshots in the repository

func ListSnapshotsRoute

func ListSnapshotsRoute(w http.ResponseWriter, req *http.Request)

func ListSnapshotsRouteFromRepo

func ListSnapshotsRouteFromRepo(w http.ResponseWriter, req *http.Request)

func ListSnapshotsWithFilters

func ListSnapshotsWithFilters(repository, password string, tags []string, host string, path string) (string, error)

ListSnapshotsWithFilters returns a filtered list of snapshots

func RemoveBackupRoute

func RemoveBackupRoute(w http.ResponseWriter, req *http.Request)

func RepoStatsRoute added in v0.21.0

func RepoStatsRoute(w http.ResponseWriter, req *http.Request)

func RestoreBackupRoute

func RestoreBackupRoute(w http.ResponseWriter, req *http.Request)

func SplitJSONObjects

func SplitJSONObjects(input string) string

SplitJSONObjects splits a string containing multiple JSON objects, respecting quotes

func StatsRepository

func StatsRepository(repository, password string) (string, error)

func StatsRepositorySubfolder

func StatsRepositorySubfolder(repository, password, snapshot, path string) (string, error)

func StatsRepositorySubfolderRoute

func StatsRepositorySubfolderRoute(w http.ResponseWriter, req *http.Request)

func UnlockRepository added in v0.21.0

func UnlockRepository(repository, password string) error

UnlockRepository removes locks from a restic repository

func UnlockRepositoryRoute added in v0.21.0

func UnlockRepositoryRoute(w http.ResponseWriter, req *http.Request)

Types

type BackupConfig

type BackupConfig struct {
	Repository         string
	Password           string
	Source             string
	Name               string
	Tags               []string
	Exclude            []string
	Retention          string
	AutoStopContainers bool
}

type LockInfo added in v0.21.0

type LockInfo struct {
	Time      string `json:"time"`
	Exclusive bool   `json:"exclusive"`
	Hostname  string `json:"hostname"`
	Username  string `json:"username"`
	PID       int    `json:"pid"`
}

func GetLocks added in v0.21.0

func GetLocks(repository, password string) []LockInfo

GetLocks returns lock details for a repository

type RestoreConfig

type RestoreConfig struct {
	Repository         string
	Password           string
	SnapshotID         string
	Target             string
	Name               string
	Include            []string
	OriginalSource     string
	AutoStopContainers bool
}

Jump to

Keyboard shortcuts

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