rsync error some files could not be transferred code 23 Command PhaseScriptExecution failed with a nonzero exit code
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Understanding the rsync Error: Some Files Could Not Be Transferred (Code 23)
The rsync utility is a powerful tool for copying and synchronizing files and directories across systems. However, you might encounter errors during these operations. One such error is "some files could not be transferred (code 23)". This article explores what this error means, why it occurs, and how to troubleshoot and resolve it.
Technical Explanation
The rsync program provides a robust method for file synchronization and transfer. It functions using a remote-update protocol, allowing it to transfer only the differences between source and destination files. Despite its efficiency, rsync can encounter several errors, with exit code 23 being one of the most common.
What is Error Code 23?
Error code 23 signifies that some files were not transferred. This non-zero exit status usually indicates that while most files were successfully synchronized, some encountered issues. These issues could be due to file permissions, missing directories, or path-related problems.
How rsync Works
To understand why error code 23 occurs, it's essential to know how rsync operates:
- File List Generation:
rsyncfirst creates a list of all files to be transferred. - Data Transfer: It transfers files that differ between the source and the destination.
- Checksums:
rsyncmay use checksums to verify file integrity upon completion.
Common Causes of Code 23
- Permission Issues: Insufficient permissions can prevent
rsyncfrom reading or writing certain files. - Missing Directories: If a destination directory does not exist and
rsyncis not set to create it, transfers can fail. - File Locks: Open files or those locked by another process might not be accessible for synchronization.
- Path Conflicts: Incorrectly specified source or destination paths can lead to transfer omissions.
- Binary Data: Transferring binary or large files without the appropriate flags can cause incomplete transfers.
Troubleshooting and Solutions
- Verify Permissions: Ensure the user running
rsynchas the necessary read/write permissions on the source and destination.

