amnesia v0.2.8 Amnesia.Backup behaviour
This module provides a behavior to implement a backup module and helpers to use backups.
Link to this section Summary
Functions
Create a checkpoint, see mnesia:activate_checkpoint
.
It's important to backup the metadata table, to avoid bugs when restoring the database.
Create a checkpoint with the given name, see mnesia:activate_checkpoint
.
Install a fallback with the default backup module, see mnesia:install_fallback
.
Install a fallback with the given backup module, see mnesia:install_fallback
.
Install a fallback with the given backup module and options, see mnesia:install_fallback
.
Restore a backup, see mnesia:restore
.
Restore a backup with the given module, see mnesia:restore
.
Start a backup with the default backup module, see mnesia:backup
.
Start a backup of a given checkpoint, see mnesia:backup_checkpoint
.
Traverse a backup, see mnesia:traverse_backup
.
Traverse a backup with custom backup modules, see mnesia:traverse_backup
.
Uninstall a fallback, see mnesia:uninstall_fallback
.
Uninstall a fallback, see mnesia:uninstall_fallback
.
Uninstall a fallback, see mnesia:uninstall_fallback
.
Callbacks
Close the backup if the backup is interrupted.
Close the backup.
Commit the write to the backup.
Open the backup for reading.
Open the backup for writing.
Read terms from the backup.
Write the given terms to the backup.
Link to this section Types
Link to this section Functions
checkpoint(options)
Create a checkpoint, see mnesia:activate_checkpoint
.
It's important to backup the metadata table, to avoid bugs when restoring the database.
Example to backup on a file called "backup" the table Account as well the metadata table:
Amnesia.Backup.checkpoint(%{
name: 'backup',
max: [Database.Account, Database]
})
checkpoint(name, options)
Create a checkpoint with the given name, see mnesia:activate_checkpoint
.
install(data)
Install a fallback with the default backup module, see mnesia:install_fallback
.
install(module, data)
Install a fallback with the given backup module, see mnesia:install_fallback
.
install(module, data, options)
Install a fallback with the given backup module and options, see mnesia:install_fallback
.
Restore a backup, see mnesia:restore
.
restore(module, data, options)
Restore a backup with the given module, see mnesia:restore
.
Start a backup with the default backup module, see mnesia:backup
.
Start a backup of a given checkpoint, see mnesia:backup_checkpoint
.
traverse(source, target, acc, fun)
Traverse a backup, see mnesia:traverse_backup
.
traverse(source, source_data, target, target_data, acc, fun)
Traverse a backup with custom backup modules, see mnesia:traverse_backup
.
Uninstall a fallback, see mnesia:uninstall_fallback
.
Uninstall a fallback, see mnesia:uninstall_fallback
.
Uninstall a fallback, see mnesia:uninstall_fallback
.
Link to this section Callbacks
Close the backup if the backup is interrupted.
Close the backup.
Commit the write to the backup.
Open the backup for reading.
Open the backup for writing.
Read terms from the backup.
Write the given terms to the backup.