Backup copies the database to file directory at the given dir.
(dir string)
| 226 | |
| 227 | // Backup copies the database to file directory at the given dir. |
| 228 | func (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. |
| 235 | func (db *DB) BackupTarGZ(w io.Writer) error { |