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:
Girish Ramakrishnan
2026-02-23 17:47:05 +01:00
parent 7ef19b318a
commit 5ba8a05450
+8
View File
@@ -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