cifs: use rsync instead cp -aRl
for some reason, cp fails on synology cifs for some paths - immich's typesense dir
This commit is contained in:
@@ -183,6 +183,14 @@ async function copyInternal(config, fromPath, toPath, options, progressCallback)
|
||||
|
||||
progressCallback({ message: `Copying ${fullFromPath} to ${fullToPath}` });
|
||||
|
||||
// on synology cifs, cp -aRl does not work for unknown reasons
|
||||
if (config._provider === mounts.MOUNT_TYPE_CIFS && !config.noHardlinks && options.recursive) {
|
||||
const rsyncArgs = ['-a', `--link-dest=${fullFromPath}/`, `${fullFromPath}/`, fullToPath];
|
||||
const [rsyncError] = await safe(shell.spawn('rsync', rsyncArgs, {}));
|
||||
if (rsyncError) throw new BoxError(BoxError.EXTERNAL_ERROR, rsyncError.message);
|
||||
return;
|
||||
}
|
||||
|
||||
let cpOptions = ((config._provider !== mounts.MOUNT_TYPE_MOUNTPOINT && config._provider !== mounts.MOUNT_TYPE_CIFS) || config.preserveAttributes) ? '-a' : '-d';
|
||||
if (options.recursive) cpOptions += 'R';
|
||||
cpOptions += config.noHardlinks ? '' : 'l'; // this will hardlink backups saving space
|
||||
|
||||
Reference in New Issue
Block a user