1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 03:26:38 +02:00

Fixed saving backups

This commit is contained in:
lethality
2012-05-09 01:23:34 +01:00
parent 820e4edc2b
commit a81b3aaff1
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -15,6 +15,7 @@
#include <unistd.h>
Anope::string DatabaseFile;
Anope::string BackupFile;
std::stringstream db_buffer;
struct ExtensibleString : Anope::string, ExtensibleItem
@@ -620,7 +621,7 @@ class DBPlain : public Module
if (tm->tm_mday != LastDay)
{
LastDay = tm->tm_mday;
Anope::string newname = "backups/" + DatabaseFile + "." + stringify(tm->tm_year) + stringify(tm->tm_mon) + stringify(tm->tm_mday);
Anope::string newname = BackupFile + "." + stringify(tm->tm_year) + stringify(tm->tm_mon) + stringify(tm->tm_mday);
/* Backup already exists */
if (IsFile(newname))
@@ -652,6 +653,7 @@ class DBPlain : public Module
{
ConfigReader config;
DatabaseFile = db_dir + "/" + config.ReadValue("db_plain", "database", "anope.db", 0);
DatabaseFile = db_dir + "/backups/" + config.ReadValue("db_plain", "database", "anope.db", 0);
}
EventReturn OnLoadDatabase() anope_override