Documentation
¶
Index ¶
- Constants
- func CreatePreMigrationBackup(h string, keep int) (string, error)
- func CreatePreUpdateBackup(h string, keep int) (string, error)
- func CreatePreUpdateSnapshotsAllProfiles(invokingHome string, keep *int, maxFileSize *int64) (*jsonutil.Object, error)
- func CreateQuickSnapshot(label *string, h string, keep *int, maxFileSize *int64) (string, error)
- func ListQuickSnapshots(limit int, h string) ([]any, error)
- func PruneQuickSnapshots(keep int, h string) (int, error)
- func QuickSnapshotDir(snapshotID, h string) (string, error)
- func QuickSnapshotRoot(h string) string
- func QuickStateFiles() []string
- func RestoreConfigModelSettingsAllProfiles(ctx context.Context, profileSnapshots *jsonutil.Object, invokingHome string) []*jsonutil.Object
- func RestoreConfigModelSettingsIfRewritten(ctx context.Context, snapshotID, h string) (*jsonutil.Object, error)
- func RestoreCronJobsAllProfiles(profileSnapshots *jsonutil.Object, invokingHome string) []*jsonutil.Object
- func RestoreCronJobsIfEmptied(snapshotID, h string) (*jsonutil.Object, error)
- func RestoreQuickSnapshot(ctx context.Context, snapshotID, h string) (bool, error)
- func RunBackup(ctx context.Context, h string, ns map[string]any, w io.Writer) (bool, error)
- func RunImport(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)
- func RunQuickBackup(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)
- func SafeRestoreDB(ctx context.Context, src, dst string) (bool, error)
- func SiblingProfileHomes(invokingHome string) [][2]string
- func SwapGatewayService(running func(context.Context) (bool, error), ...) (restore func())
- func SwapMemoryProviderExternalPaths(f func(ctx context.Context, h string) []string) (restore func())
- type BackupInProgressError
- type IntegrityOptions
- type IntegrityResult
- type Interrupted
- type SystemExit
Constants ¶
const ( // Pre update archives kept when the caller names no retention PreUpdateDefaultKeep = 5 // Pre migration archives kept when the caller names no retention PreMigrationDefaultKeep = 5 )
const DefaultIntegrityCheckMaxBytes int64 = 2 << 30
Size above which the full integrity check yields to the header and schema probe
Variables ¶
This section is empty.
Functions ¶
func CreatePreMigrationBackup ¶
Full zip of a home before an agent import into backups/pre-migration-<timestamp>.zip, empty when skipped or incomplete
func CreatePreUpdateBackup ¶
Full zip of a home before an update into backups/pre-update-<timestamp>.zip, empty when skipped or incomplete
func CreatePreUpdateSnapshotsAllProfiles ¶
func CreatePreUpdateSnapshotsAllProfiles(invokingHome string, keep *int, maxFileSize *int64) (*jsonutil.Object, error)
Pre update quick snapshots of every sibling profile into its own home, mapping name to snapshot id
func CreateQuickSnapshot ¶
Quick snapshot of a home under the backup slot, the id or empty when nothing was captured
func ListQuickSnapshots ¶
Manifests of the newest quick snapshots up to the limit, a stub entry for an unreadable manifest
func PruneQuickSnapshots ¶
Prunes the quick snapshots of a home down to keep and returns how many were deleted
func QuickSnapshotDir ¶
Directory of a restorable quick snapshot, empty for an invalid, escaping or missing id, failing where resolve fails
func QuickSnapshotRoot ¶
Directory holding the quick state snapshots of a home, the home in effect when empty
func QuickStateFiles ¶
func QuickStateFiles() []string
Critical state files and directories of a home a quick snapshot copies, as a fresh slice
func RestoreConfigModelSettingsAllProfiles ¶
func RestoreConfigModelSettingsAllProfiles(ctx context.Context, profileSnapshots *jsonutil.Object, invokingHome string) []*jsonutil.Object
Config model settings safety net of every sibling profile, one result per restored profile
func RestoreConfigModelSettingsIfRewritten ¶
func RestoreConfigModelSettingsIfRewritten(ctx context.Context, snapshotID, h string) (*jsonutil.Object, error)
Restores the protected model and MoA keys an update rewrote, nil when nothing was done
func RestoreCronJobsAllProfiles ¶
func RestoreCronJobsAllProfiles(profileSnapshots *jsonutil.Object, invokingHome string) []*jsonutil.Object
Cron jobs safety net of every sibling profile, one result per restored profile
func RestoreCronJobsIfEmptied ¶
Restores cron/jobs.json from the pre-update snapshot when the live file lost jobs, nil when nothing was done
func RestoreQuickSnapshot ¶
Restores a whole quick snapshot offline, false when the profile is owned or any listed file is refused
func RunImport ¶
Restores a backup archive into the home, exit status one for damaged archives or incomplete restores
func RunQuickBackup ¶
icebath backup --quick, one quick snapshot of the home in effect and where it is stored
func SafeRestoreDB ¶
SafeRestoreDB exposes the page restore under the destination reservation to the update auto restore
func SiblingProfileHomes ¶
Name and home of every other profile of this install, default for the root home, never failing
Types ¶
type BackupInProgressError ¶
type BackupInProgressError struct{ Msg string }
Another process already owns the backup slot
func (*BackupInProgressError) Error ¶
func (e *BackupInProgressError) Error() string
type IntegrityOptions ¶
Options of a SQLite verification, the zero value meaning header check, pragma and the default size cap
type IntegrityResult ¶
Outcome of a SQLite verification, Size nil when the file could not be stat'd
func VerifySQLiteIntegrity ¶
func VerifySQLiteIntegrity(path string, opts IntegrityOptions) IntegrityResult
Verifies a SQLite file by size, header magic, then integrity_check or the cheap probe above the size cap
type Interrupted ¶
type Interrupted struct{ Cause error }
Interruption of a copy by a stop request, passing every handler that catches ordinary failures
func (*Interrupted) Error ¶
func (e *Interrupted) Error() string
func (*Interrupted) Unwrap ¶
func (e *Interrupted) Unwrap() error
type SystemExit ¶
type SystemExit struct{ Code int }
Process exit a backup command requests, the status the CLI returns
func (*SystemExit) Error ¶
func (e *SystemExit) Error() string