I am using Ruby on Rails and the Capistrano gem. I would like to improve the following command that runs in a recipe (I was inspired by the blog post “Uploading files for enki using capistrano“):
rsync -qrpt --delete --rsh=ssh public/system/assets/users/001 #{user}@#{domain}:/www/.../shared/system/assets/001
so to make possible to create sub-directories “on the fly”. At this time, since on the remote machine the assets/users/001 directory does not exist yet, I get the following error:
rsync: mkdir "/www/.../shared/system/assets/users/001" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(595) [Receiver=3.0.7]
rsync: connection unexpectedly closed (8 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-40/rsync/io.c(452) [sender=2.6.9]
How can I create all needed sub-directories so to avoid errors?
BTW: what the -qrpt part means?
Try adding the -R option:
per http://ubuntuforums.org/showthread.php?t=1670723
read http://ss64.com/bash/rsync.html