Backup & Recovery (Rsync/Tar/Dd)
Stop rsync from choking when it hits files currently being modified
đź§© The Challenge
You ever try to rsync a live database or a logging directory only to have the process puke because a file changed mid-read? I’ve lost half a morning trying to track down why a transfer failed halfway through because some log file rotated under my feet.
đź’ˇ The Fix
Use the –inplace flag to tell rsync to write the new data directly to the existing file instead of creating a temp file and swapping it. This stops the constant re-transferring of giant files that are just getting appended to.
rsync -av --inplace --partial /source/directory/ /destination/directory/
⚙️ Why It Works
By skipping the write-and-rename dance, you stop hitting those “file has vanished” errors that happen when the source file changes while rsync is still debating what to do with it.
🚀 Pro-Tip: Always include –partial so you don’t have to restart the whole transfer when your network inevitably hiccups.
Linux Tips & Tricks | © ngelinux.com | 7/17/2026
