Software⏱️ 3 min read📅 2026-06-19

How to Fix code 23 Error – rsync error: exit code 23 ( No such file or directory (2) )

Rsync error code 23: No such file or directory (2) when copying Windows files with special characters in their names.

Quick Answer: Use the -o dirpath=lossless option to preserve file paths with special characters.

The rsync error 'exit code 23 ( No such file or directory (2) )' occurs when Rsync is unable to find a file on the destination server, despite the file existing locally. This issue affects users who are using Rsync to synchronize files between two servers or local directories.

This error can be frustrating because it prevents the entire synchronization process from completing, leaving some files behind. However, with the right troubleshooting steps and fixes, you can resolve this issue and ensure that all files are successfully copied.

🔍 Why This Happens

  • The primary reason for this error is the presence of special characters in file names, such as dollar signs or double dots, which Rsync cannot handle. When Rsync encounters a file name with these characters, it throws an error and exits with a non-zero status code.
  • Another possible cause is incorrect path handling or directory traversal issues, where Rsync incorrectly assumes the existence of a file on the destination server.

✅ Best Solutions to Fix It

Using wildcards to match files with special characters

  1. Step 1: To fix this issue using wildcards, modify your Rsync command to include a wildcard that matches any file name containing special characters. For example, you can use the '*' wildcard to match any characters.
  2. Step 2: Update your Rsync command to: rsync.exe -rltDvP -W --delete --progress '/cygdrive/C/source/Downloads/Unpacked/*' '//serverName/destination' --exclude 'OK.marker' --modify-window=2'
  3. Step 3: The '*' wildcard will match any file name, including those with dollar signs or double dots. This ensures that Rsync can handle files with special characters in their names.

Using the -o subdirectory-permissions option

  1. Step 1: Alternatively, you can use the '-o' option to set subdirectory permissions on the destination server. This allows Rsync to create directories and files with special characters in their names.
  2. Step 2: Add the following options to your Rsync command: -o subdirectory-permissions=755, -o dirperm=775
  3. Step 3: The 'subdirectory-permissions' option sets the permissions for subdirectories on the destination server. The 'dirperm' option sets the permissions for directories on the destination server.

🎯 Final Words

To resolve the rsync error 'exit code 23 ( No such file or directory (2) )', you can try using wildcards to match files with special characters in their names, or set subdirectory permissions on the destination server. By following these steps, you should be able to ensure that all files are successfully copied during the synchronization process.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions