From b54f10af5524ef60884c004a900d77d5f8d9b585 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Fri, 20 Mar 2026 11:56:53 -0600 Subject: [PATCH] fix: rsync backup bugs and optimize flags for encrypted CIFS targets - Fix restoreBackup using backupOptions instead of restoreOptions - Add missing await on preRestore/postRestore hooks - Remove -c (checksum) flag that forced full reads on every run - Add --partial to keep partially transferred files on interruption - Add --inplace to avoid temp-file+rename metadata churn - Add --timeout=300 to prevent hangs on stalled mounts --- sdk/package/lib/backup/Backups.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sdk/package/lib/backup/Backups.ts b/sdk/package/lib/backup/Backups.ts index 5acefcb1c..05efb2554 100644 --- a/sdk/package/lib/backup/Backups.ts +++ b/sdk/package/lib/backup/Backups.ts @@ -221,7 +221,7 @@ export class Backups implements InitScript { * @param effects - The effects context */ async restoreBackup(effects: T.Effects) { - this.preRestore(effects as BackupEffects) + await this.preRestore(effects as BackupEffects) for (const item of this.backupSet) { const rsyncResults = await runRsync({ @@ -229,9 +229,9 @@ export class Backups implements InitScript { dstPath: item.dataPath, options: { ...this.options, - ...this.backupOptions, + ...this.restoreOptions, ...item.options, - ...item.backupOptions, + ...item.restoreOptions, }, }) await rsyncResults.wait() @@ -242,7 +242,7 @@ export class Backups implements InitScript { }) .catch((_) => null) if (dataVersion) await effects.setDataVersion({ version: dataVersion }) - this.postRestore(effects as BackupEffects) + await this.postRestore(effects as BackupEffects) return } } @@ -268,7 +268,10 @@ async function runRsync(rsyncOptions: { for (const exclude of options.exclude) { args.push(`--exclude=${exclude}`) } - args.push('-rlptgocAXH') + args.push('-rlptgoAXH') + args.push('--partial') + args.push('--inplace') + args.push('--timeout=300') args.push('--info=progress2') args.push('--no-inc-recursive') args.push(srcPath)