MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / Backup

Method Backup

db.go:228–232  ·  view source on GitHub ↗

Backup copies the database to file directory at the given dir.

(dir string)

Source from the content-addressed store, hash-verified

226
227// Backup copies the database to file directory at the given dir.
228func (db *DB) Backup(dir string) error {
229 return db.View(func(tx *Tx) error {
230 return filesystem.CopyDir(db.opt.Dir, dir)
231 })
232}
233
234// BackupTarGZ Backup copy the database to writer.
235func (db *DB) BackupTarGZ(w io.Writer) error {

Callers 1

TestDB_BackupFunction · 0.80

Calls 1

ViewMethod · 0.95

Tested by 1

TestDB_BackupFunction · 0.64