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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user