diff --git a/src/routes/system/SystemRouter.ts b/src/routes/system/SystemRouter.ts index cd069f5..b1bcf8f 100644 --- a/src/routes/system/SystemRouter.ts +++ b/src/routes/system/SystemRouter.ts @@ -25,6 +25,14 @@ router.post('/createbackup/', function(req, res, next) { }) .then(function(pathOfBackup) { res.download(pathOfBackup, function(err) { + if (err) { + Logger.e(err) + } + + Logger.d( + `Downloading backup finished: ${pathOfBackup} Removing directory...` + ) + backupManager.deleteBackupDirectoryIfExists() }) })