Skip to content

/errors/rsync/mkdir-failed-no-such-file-or-directory

rsync: [Receiver] mkdir "/path" failed: No such file or directory (2)

The commands on this page have not been executed by our verification runner yet.updated
tool
rsync
exit code
11
versions
rsync 3.x
os
linux, macos

rsync: [Receiver] mkdir "/backup/2026/10" failed: No such file or directory (2) means the destination directory does not exist and one of its parents does not exist either. rsync creates only the final component of the destination path; a missing parent is treated as an error, to catch typos. rsync stops with rsync error: error in file IO (code 11). Add --mkpath to create the whole path (rsync 3.2.3 or later), or run mkdir -p on the destination first.

What the output looks like

The message is built by rsyserr() in rsync's log.c: the role in brackets, the quoted path, then the system error text and errno:

text
rsync: [Receiver] mkdir "/backup/2026/10" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(N) [Receiver=3.x.y]

The role in brackets names the rsync process that hit the error (Receiver, receiver, generator, sender, client or server). main.c(N) and the version vary.

Fix: --mkpath

bash
rsync -a --mkpath ./reports/ backup.example.com:/backup/2026/10/

--mkpath creates every missing component of the destination path, like mkdir -p on the receiving side. It was added in rsync 3.2.3; the receiving rsync must support it. Check with rsync --version on both machines. With a trailing slash on the destination, the whole path is treated as directories, even when you copy a single file.

Fix: create the parents first

When the remote rsync is older than 3.2.3:

bash
ssh backup.example.com 'mkdir -p /backup/2026/10'
rsync -a ./reports/ backup.example.com:/backup/2026/10/

Check the path

  • host:backup/2026 (no leading slash) is relative to the remote user's home directory, so it may not be the directory you expect.
  • If the destination is a mount point (an external disk, an NFS or SMB share), check that it is mounted: copying into the empty mount point directory fills the root filesystem instead.
  • A similar message with Permission denied (13) instead of No such file or directory (2) means the parent exists but your user cannot write to it.

Sources