rsync: mkstemp failed: No such file or directory (2)

John Van Essen vanes002 at
Sat May 14 08:45:00 GMT 2005

On Fri, 13 May 2005, <apache7 at> wrote:
> Hello everyone,
> Server1: Harmony
> Server2: Peace

I have no idea what those are...  What O/S are you using?

> I tried the following command on Server1:
>     rsync -vrlpogt --delete-after /LocalImg/ Server2::Img
> The directories were created on Server2, but no files were copied!
> I got the following error message repeating for each file it failed to copy:
> rsync: mkstemp "/tmp/.008902000072_0181.PNG.KnfE9V" (in Img) failed: No such
> file or directory (2)
> I tried rsync 2.6.5pre1 but got the same problem.

Rsync does not use /tmp for incoming files unless it's specifically
told to do so.  By default, it creates the temporary file in the
destination directory.  So mkstemp apparently is being emulated by
some other function that unconditionally uses /tmp.  Not a good thing...

The cause for the error is that you are sending to a daemon, and the
default for a daemon is  chroot = yes  which means that there is no
/tmp directory accessible by rsync after the chroot is done.

Workaround is to use  chroot = no  in rsyncd.conf.  To be safe, I'd
suggest removing the --delete-after from your restore rsync since there
shouldn't be anything to delete on a new partition.

You should try to discover why mkstemp is using /tmp to solve it once
and for all.
        John Van Essen  Univ of Minn. Alumnus  <vanes002 at>

More information about the rsync mailing list