1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 02:46:37 +02:00

check if the database exists before we try to backup it

This commit is contained in:
DukePyrolator
2013-01-12 09:01:44 +01:00
parent 5007b72b28
commit 402e42fd15
+2 -2
View File
@@ -102,8 +102,8 @@ class DBFlatFile : public Module, public Pipe
const Anope::string &oldname = Anope::DataDir + "/" + *it;
Anope::string newname = Anope::DataDir + "/backups/" + *it + "." + stringify(tm->tm_year) + "." + stringify(tm->tm_mon) + "." + stringify(tm->tm_mday);
/* Backup already exists */
if (Anope::IsFile(newname))
/* Backup already exists or no database to backup */
if (Anope::IsFile(newname) || !Anope::IsFile(oldname))
continue;
Log(LOG_DEBUG) << "db_flatfile: Attemping to rename " << *it << " to " << newname;