rsync - create all missing parent directories?

前端 未结 7 1443
一个人的身影
一个人的身影 2020-12-29 01:32

I\'m looking for an rsync-like program which will create any missing parent directories on the remote side.

For example, if I have /top/a/b/c/d

7条回答
  •  时光说笑
    2020-12-29 01:49

    rsync -aq --rsync-path='mkdir -p /tmp/imaginary/ && rsync' file user@remote:/tmp/imaginary/
    

    From http://www.schwertly.com/2013/07/forcing-rsync-to-create-a-remote-path-using-rsync-path/, but don't copy and paste from there, his syntax is butchered.

    it lets you execute arbitrary command to setup the path for rsync executables.

提交回复
热议问题