From 402e42fd15bd9be4b721118bbbae03e22d9f433e Mon Sep 17 00:00:00 2001 From: DukePyrolator Date: Sat, 12 Jan 2013 09:01:44 +0100 Subject: [PATCH] check if the database exists before we try to backup it --- modules/database/db_flatfile.cpp | 4 ++-- 1 file 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;