backups: encode extension into the remotePath

This commit is contained in:
Girish Ramakrishnan
2025-08-01 20:40:48 +02:00
parent 53e9925880
commit ff6cbf6628
2 changed files with 19 additions and 16 deletions
+2 -5
View File
@@ -20,13 +20,10 @@ function getBackupFilePath(backupTarget, remotePath) {
assert.strictEqual(typeof backupTarget, 'object');
assert.strictEqual(typeof remotePath, 'string');
const rootPath = backupTarget.config.rootPath;
const fileType = backupTarget.encryption ? '.tar.gz.enc' : '.tar.gz';
// we don't have a rootPath for noop
if (backupTarget.provider === 'noop') return remotePath + fileType;
if (backupTarget.provider === 'noop') return remotePath;
return path.join(rootPath, remotePath + fileType);
return path.join(backupTarget.config.rootPath, remotePath);
}
// In tar, the entry header contains the file size. If we don't provide it those many bytes, the tar will become corrupt