summaryrefslogtreecommitdiff
path: root/src/modules/os_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/os_info.c')
-rw-r--r--src/modules/os_info.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/modules/os_info.c b/src/modules/os_info.c
index e1af20d8c..9f2d3aa05 100644
--- a/src/modules/os_info.c
+++ b/src/modules/os_info.c
@@ -55,6 +55,7 @@ void m_AddLanguages(void);
int mLoadData(void);
int mSaveData(int argc, char **argv);
+int mBackupData(int argc, char **argv);
int mLoadConfig();
int mEventReload(int argc, char **argv);
@@ -99,6 +100,9 @@ int AnopeInit(int argc, char **argv)
hook = createEventHook(EVENT_DB_SAVING, mSaveData);
status = moduleAddEventHook(hook);
+ hook = createEventHook(EVENT_DB_BACKUP, mBackupData);
+ status = moduleAddEventHook(hook);
+
hook = createEventHook(EVENT_RELOAD, mEventReload);
status = moduleAddEventHook(hook);
@@ -450,6 +454,17 @@ int mSaveData(int argc, char **argv)
}
/**
+ * Backup our databases using the commands provided by Anope
+ * @return MOD_CONT
+ **/
+int mBackupData(int argc, char **argv)
+{
+ ModuleDatabaseBackup(OSInfoDBName);
+
+ return MOD_CONT;
+}
+
+/**
* Load the configuration directives from Services configuration file.
* @return 0 for success
**/