module

ActiveBackup::Archive

Constants

DB_MEMBER = "db.dump"
FILES_PREFIX = "files/"
MANIFEST_MEMBER = "manifest.json"

Class methods

copy_with_digest(abs : String, io : IO, digest : Digest) : Nil

Copies a file into the archive member io while hashing. Kept as a separate method: nesting this File.open block inside the add_file block trips a Crystal 1.21 codegen bug (nested block inlining) at the call site.

Source
read_manifest(path : String) : JSON::Any
Source
restore(path : String, *, database_url : String | Nil = nil, roots : Hash(String, String) = {} of String => String, clean : Bool = false, verify : Bool = true) : JSON::Any

Restores a backup: verifies member checksums, restores file trees and the database. roots overrides manifest destinations ({"storage" => "/new/loc"}); clean: true drops objects before recreating them (pg_restore --clean). Returns the manifest.

Source
sha256_file(path : String) : String
Source
write(path : String, *, database_url : String | Nil, dirs : Array(Tuple(String, String)) = [] of Tuple(String, String), app : String | Nil = nil, now : Time = Time.utc) : Nil

Writes a backup archive to path. dirs: pairs of {archive name, source directory}.

Source