diff options
author | DukePyrolator <DukePyrolator@anope.org> | 2013-01-12 09:01:44 +0100 |
---|---|---|
committer | DukePyrolator <DukePyrolator@anope.org> | 2013-01-12 09:01:44 +0100 |
commit | 402e42fd15bd9be4b721118bbbae03e22d9f433e (patch) | |
tree | bc8889a20dd5bd93b58a525bf0a2b60b0885ce7d | |
parent | 5007b72b28fe853960db4141c222f713ac5b9eb7 (diff) |
check if the database exists before we try to backup it
-rw-r--r-- | modules/database/db_flatfile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp index da8da0923..6208b7afe 100644 --- a/modules/database/db_flatfile.cpp +++ b/modules/database/db_flatfile.cpp @@ -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; |