diff --git a/nextcloud_backup/backend/src/routes/action.ts b/nextcloud_backup/backend/src/routes/action.ts index 4f44e6c..ee12c59 100644 --- a/nextcloud_backup/backend/src/routes/action.ts +++ b/nextcloud_backup/backend/src/routes/action.ts @@ -27,6 +27,9 @@ actionRouter.post("/clean", (req, res) => { .then(() => { return clean(backupConfig); }) + .then(() => { + return webdavClean(backupConfig, webdavConfig); + }) .then(() => { logger.info("All good !"); }) diff --git a/nextcloud_backup/backend/src/services/webdavService.ts b/nextcloud_backup/backend/src/services/webdavService.ts index 5ed0c7e..64af6f7 100644 --- a/nextcloud_backup/backend/src/services/webdavService.ts +++ b/nextcloud_backup/backend/src/services/webdavService.ts @@ -644,7 +644,7 @@ export function clean(backupConfig: BackupConfig, webdavConfig: WebdavConfig) { status.status = States.CLEAN_CLOUD; status.progress = -1; statusTools.setStatus(status); - const limit = backupConfig.autoClean.homeAssistant.nbrToKeep || 5; + const limit = backupConfig.autoClean.webdav.nbrToKeep || 5; return getBackups(pathTools.auto, webdavConfig, backupConfig.nameTemplate) .then((backups) => { if (backups.length > limit) {