S
S
SerjAntiquity2015-06-08 22:21:42
linux
SerjAntiquity, 2015-06-08 22:21:42

How to force rsync to create missing directories?

For example:

rsync -avr --delete /home/serjantiquity/work/mam/src/1/3q/RS /home/serjantiquity/work/mam/dst/1/3q

in /home/serjantiquity/work/mam/dst there really are no "1" and "3q" directories, I want to teach rsync how to create them
.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Adamos, 2015-06-08
@SerjAntiquity

On SO, it is advised to use this hack:

--rsync-path="mkdir -p /home/serjantiquity/work/mam/dst/1/3q && rsync"

V
Vlad Zhivotnev, 2015-06-10
@inkvizitor68sl

rsync -avr --delete /home/serjantiquity/work/mam/src/1/3q/RS/ /home/serjantiquity/work/mam/dst/1/3q/RS/
The trailing slashes are important.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question