backups: root ~~canal~~ path surgery

remove rootPath and getBackupFilePath from the backup target and
make this backend specific.
This commit is contained in:
Girish Ramakrishnan
2025-08-02 01:46:29 +02:00
parent a01e1bad0f
commit c935744f4c
15 changed files with 378 additions and 373 deletions
+4 -8
View File
@@ -226,12 +226,10 @@ async function download(backupTarget, remotePath, dataLayout, progressCallback)
debug(`download: Downloading ${remotePath} to ${dataLayout.toString()}`);
const backupFilePath = backupTargets.getBackupFilePath(backupTarget, remotePath);
await promiseRetry({ times: 5, interval: 20000, debug }, async () => {
progressCallback({ message: `Downloading backup ${backupFilePath}` });
progressCallback({ message: `Downloading backup ${remotePath}` });
const sourceStream = await backupTargets.storageApi(backupTarget).download(backupTarget.config, backupFilePath);
const sourceStream = await backupTargets.storageApi(backupTarget).download(backupTarget.config, remotePath);
await tarExtract(sourceStream, dataLayout, backupTarget.encryption, progressCallback);
});
}
@@ -244,12 +242,10 @@ async function upload(backupTarget, remotePath, dataLayout, progressCallback) {
debug(`upload: Uploading ${dataLayout.toString()} to ${remotePath}`);
const backupFilePath = backupTargets.getBackupFilePath(backupTarget, remotePath);
await promiseRetry({ times: 5, interval: 20000, debug }, async () => {
progressCallback({ message: `Uploading backup ${backupFilePath}` });
progressCallback({ message: `Uploading backup ${remotePath}` });
const uploader = await backupTargets.storageApi(backupTarget).upload(backupTarget.config, backupFilePath);
const uploader = await backupTargets.storageApi(backupTarget).upload(backupTarget.config, remotePath);
await tarPack(dataLayout, backupTarget.encryption, uploader, progressCallback);
});
}