Module mod_backup

Backup module.

Copyright © 2010-2012 Marc Worrell

Behaviours: gen_server.

Authors: Marc Worrell (marc@worrell.nl).

Description

Backup module. Creates backup of the database and files. Allows downloading of the backup. Support creation of periodic backups.

Function Index

backup_in_progress/1Check if there is a backup in progress.
check_configuration/0Check if we can make backups, the configuration is ok.
code_change/3Convert process state when code is changed.
file_exists/2Callback for controller_file_readonly.
file_forbidden/2Callback for controller_file_readonly.
handle_call/3Start a backup.
handle_cast/2Trap unknown casts.
handle_info/2Periodic check if a scheduled backup should start.
init/1Initiates the server.
list_backups/1List all backups present.
manage_schema/2
observe_admin_menu/3
observe_rsc_update/3
observe_rsc_upload/2
start_backup/1Start a backup.
start_backup/2Start a backup, either a full backup (including archived files) or a database only backup.
start_link/1Starts the server.
terminate/2This function is called by a gen_server when it is about to terminate.

Function Details

backup_in_progress/1

backup_in_progress(Context) -> any()

Check if there is a backup in progress.

check_configuration/0

check_configuration() -> any()

Check if we can make backups, the configuration is ok

code_change/3

code_change(OldVsn, State, Extra) -> {ok, NewState}

Convert process state when code is changed

file_exists/2

file_exists(File, Context) -> any()

Callback for controller_file_readonly. Check if the file exists.

file_forbidden/2

file_forbidden(File, Context) -> any()

Callback for controller_file_readonly. Check if access is allowed.

handle_call/3

handle_call(Message::Request, From, State) -> {reply, Reply, State} | {reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} | {stop, Reason, Reply, State} | {stop, Reason, State}

Start a backup

handle_cast/2

handle_cast(Message::Msg, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

Trap unknown casts

handle_info/2

handle_info(Info, State) -> {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}

Periodic check if a scheduled backup should start

init/1

init(Args) -> {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}

Initiates the server.

list_backups/1

list_backups(Context) -> any()

List all backups present. Newest first.

manage_schema/2

manage_schema(X1, Context) -> any()

observe_admin_menu/3

observe_admin_menu(Admin_menu, Acc, Context) -> any()

observe_rsc_update/3

observe_rsc_update(Rsc_update, Acc, Context) -> any()

observe_rsc_upload/2

observe_rsc_upload(Rsc_upload, Context) -> any()

start_backup/1

start_backup(Context) -> any()

Start a backup

start_backup/2

start_backup(IsFullBackup, Context) -> any()

Start a backup, either a full backup (including archived files) or a database only backup.

start_link/1

start_link(Args) -> {ok, Pid} | ignore | {error, Error}

Starts the server

terminate/2

terminate(Reason, State) -> void()

This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.


Generated by EDoc