Documentation
¶
Overview ¶
Package backup copies everything Antares keeps into one file, and puts it back.
Everything worth keeping is in one directory, so a backup is a tarball of that directory minus the parts that regenerate themselves. The point of having it in-process rather than telling people to run tar is that the database has to be quiesced first — copying a SQLite file mid-write produces an archive that restores into a corrupt database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Info ¶
type Info struct {
Path string `json:"path"`
Name string `json:"name"`
Size int64 `json:"size"`
CreatedAt time.Time `json:"created_at"`
}
Info describes one archive.
func Create ¶
Create writes a gzipped tar of home into dir and returns what it wrote.
extra names files outside the state directory that belong in the backup — in practice a SQLite database whose DSN points somewhere else. Without this the archive would silently omit the one thing it exists to protect.
quiesce is called before reading anything and is where the caller checkpoints the database; without it the archive can hold a torn file.