Use the full backup paths for sshfs remote copy

Fixes #889
This commit is contained in:
Johannes Zellner
2026-04-14 12:46:41 +02:00
parent feacb58cd1
commit a4ea80cf5e

View File

@@ -202,7 +202,7 @@ async function copyInternal(config, fromPath, toPath, options, progressCallback)
if (!safe.fs.writeFileSync(identityFilePath, `${config.mountOptions.privateKey}\n`, { mode: 0o600 })) throw new BoxError(BoxError.FS_ERROR, `Could not write temporary private key: ${safe.error.message}`);
const sshOptions = [ '-o', 'StrictHostKeyChecking no', '-i', identityFilePath, '-p', config.mountOptions.port, `${config.mountOptions.user}@${config.mountOptions.host}` ];
const sshArgs = sshOptions.concat([ 'cp', cpOptions, path.join(config.prefix ?? '', fromPath), path.join(config.prefix ?? '', toPath) ]);
const sshArgs = sshOptions.concat([ 'cp', cpOptions, path.join(config.mountOptions.remoteDir, config.prefix ?? '', fromPath), path.join(config.mountOptions.remoteDir, config.prefix ?? '', toPath) ]);
const [remoteCopyError] = await safe(shell.spawn('ssh', sshArgs, {}));
safe.fs.unlinkSync(identityFilePath);
if (!remoteCopyError) return;