1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 11:36: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
@@ -16,6 +16,7 @@
class DBFlatFile : public Module
{
Anope::string DatabaseFile;
Anope::string BackupFile;
/* Day the last backup was on */
int LastDay;
/* Backup file names */
@@ -46,7 +47,7 @@ class DBFlatFile : 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))
@@ -77,6 +78,7 @@ class DBFlatFile : public Module
{
ConfigReader config;
DatabaseFile = db_dir + "/" + config.ReadValue("db_flatfile", "database", "anope.db", 0);
BackupFile = db_dir + "/backups/" + config.ReadValue("db_flatfile", "database", "anope.db", 0);
}
EventReturn OnLoadDatabase() anope_override