diff --git a/lib/backup.ts b/lib/backup.ts index c787cdf..3df4c9d 100644 --- a/lib/backup.ts +++ b/lib/backup.ts @@ -1,4 +1,4 @@ -import { createWriteStream, mkdirSync } from 'fs'; +import { createWriteStream, mkdirSync, unlinkSync } from 'fs'; import { createGzip } from 'zlib'; import { join } from 'path'; import { spawn } from 'child_process'; @@ -115,6 +115,7 @@ async function runBackup(): Promise { ); }); + unlinkSync(localPath); console.log(`[backup] ${filename} → ${sshHost}:${remotePath}`); // Backups älter als 30 Tage auf Remote löschen