shell: copy over code and signal values from cp object

This commit is contained in:
Girish Ramakrishnan
2024-07-22 21:24:27 +02:00
parent 44678cf5f1
commit b26ff08a3c
2 changed files with 7 additions and 1 deletions

View File

@@ -177,7 +177,7 @@ async function copy(apiConfig, oldFilePath, newFilePath, progressCallback) {
const sshArgs = sshOptions.concat([ 'cp', cpOptions, oldFilePath.replace('/mnt/cloudronbackup/', ''), newFilePath.replace('/mnt/cloudronbackup/', '') ]);
const [remoteCopyError] = await safe(shell.execArgs('copy', 'ssh', sshArgs, { shell: true }));
if (!remoteCopyError) return;
if (remoteCopyError?.code === 255) throw new BoxError(BoxError.EXTERNAL_ERROR, `SSH connection error: ${remoteCopyError.message}`); // do not attempt fallback copy for ssh errors
if (remoteCopyError.code === 255) throw new BoxError(BoxError.EXTERNAL_ERROR, `SSH connection error: ${remoteCopyError.message}`); // do not attempt fallback copy for ssh errors
debug('SSH remote copy failed, trying ssfs copy'); // this can happen for sshfs mounted windows server
}