As I can see rsync
can't sync file if some of directories in file path doesn't exist. Why it doesn't create this directories with mkdir -p
command? Maybe it has an option for that? -r
option doesn't work in that case.
Somebody asked a similar question here:
rsync: how can I configure it to create target directory on server?
It doesn't look like rsync
is able to do that. You would have to write a wrapper script that does a mkdir -p
on the target directory before executing rsync
. If your target directory is on a different server, you might be able to run the mkdir -p
command in a script through ssh
.