implement logic to use backup folder if origin is unreachable and once reachable, move data to origin

This commit is contained in:
WorldTeacher
2024-08-02 08:42:52 +02:00
parent 5e706022bc
commit 0fb525ad4e
2 changed files with 137 additions and 21 deletions

View File

@@ -9,6 +9,8 @@ class Backup:
self.source_path = config.database.path + "/" + config.database.name
self.backup_path = config.database.backupLocation + "/" + config.database.name
self.backup = False
if not os.path.exists(config.database.backupLocation):
os.makedirs(config.database.backupLocation)
if config.database.do_backup == True:
self.checkpaths()
config.database.do_backup = self.backup