incremental directory searche in rsync 3.0.6

Matt McCutchen matt at mattmccutchen.net
Tue May 19 05:54:02 GMT 2009


On Tue, 2009-05-19 at 10:58 +0530, Jignesh Shah wrote:
> I was in under impression that rsync 3.0.5/3.0.6 creates all the
> missing directories in the path but I think I am wrong. Could any one
> tell me is it possible to create all missing dirs in path at
> destination side if not exists. Currently, I have been getting below
> errors.
>  
> rsync -avz  /tmp/mytest/rsync-test/dir-test/parent-dir/
> desthost:/tmp/mytest/rsync-test/dir-test/parent-dir/
> sending incremental file list
> rsync: mkdir "/tmp/mytest/rsync-test/dir-test/parent-dir/" failed: No
> such file or directory (2)
> rsync error: error in file IO (code 11) at main.c(576)
> [receiver=3.0.6]
> rsync: connection unexpectedly closed (9 bytes received so far)
> [sender]
> rsync error: error in rsync protocol data stream (code 12) at
> io.c(600) [sender=3.0.6]
> 
> I want rsync to create "/mytest/rsync-test/dir-test/parent-dir/"
> directory heirarchy at destination. I also tried with --relative and
> --no-implied-dirs/--implied-dirs but no luck.

https://bugzilla.samba.org/show_bug.cgi?id=4621#c3
http://lists.samba.org/archive/rsync/2007-October/018993.html

Rsync does not create parents of the specified destination directory.
You can instead move to a higher destination directory and use
--relative to place the files appropriately under it, and rsync will
create intervening directories as necessary:

rsync -avz --relative /tmp/mytest/rsync-test/dir-test/parent-dir/ desthost:/

The behavior here is the same regardless of incremental recursion.

-- 
Matt



More information about the rsync mailing list