storage: add copyDir

we changed listDir in c44863a9bb to list
a directory . this broke copy for files since a '/' is added when listing
the file.
This commit is contained in:
Girish Ramakrishnan
2025-08-25 23:45:14 +02:00
parent cdda8649fc
commit 31df40a841
7 changed files with 90 additions and 14 deletions
+3 -3
View File
@@ -244,16 +244,16 @@ async function copy(backupTarget, srcRemotePath, destRemotePath, progressCallbac
assert.strictEqual(typeof progressCallback, 'function');
const startTime = new Date();
const [copyError] = await safe(backupTargets.storageApi(backupTarget).copy(backupTarget.config, srcRemotePath, destRemotePath, progressCallback));
const [copyError] = await safe(backupFormats.api(backupTarget.format).copy(backupTarget, srcRemotePath, destRemotePath, progressCallback));
if (copyError) {
debug(`copy: copied to ${destRemotePath} errored. error: ${copyError.message}`);
debug(`copy: copy to ${destRemotePath} errored. error: ${copyError.message}`);
throw copyError;
}
debug(`copy: copied successfully to ${destRemotePath}. Took ${(new Date() - startTime)/1000} seconds`);
const [copyChecksumError] = await safe(backupTargets.storageApi(backupTarget).copy(backupTarget.config, `${srcRemotePath}.backupinfo`, `${destRemotePath}.backupinfo`, progressCallback));
if (copyChecksumError) {
debug(`copy: copied to ${destRemotePath} errored. error: ${copyChecksumError.message}`);
debug(`copy: copy to ${destRemotePath} errored. error: ${copyChecksumError.message}`);
throw copyChecksumError;
}
debug(`copy: copied backupinfo successfully to ${destRemotePath}.backupinfo`);