diff --git a/back/services/cron.ts b/back/services/cron.ts index 90d1d045..1a7dd6c8 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -360,7 +360,7 @@ export default class CronService { } if (doc.log_path) { - const relativeDir = `${doc.log_path.replace(/\/[^\/]\..*/, '')}`; + const relativeDir = path.dirname(`${doc.log_path}`); const dir = path.resolve(config.logPath, relativeDir); if (existsSync(dir)) { let files = await promises.readdir(dir);