How to force rsync to create destination folder

前端 未结 3 1993
慢半拍i
慢半拍i 2021-02-01 14:25

Example:

rsync /tmp/fol1/fol2/fol3/foln user@addr:/tmp/fol1/fol2/fol3/foln

My main problem is folder /tmp/fol1 doesn\'t exist on remote machine

3条回答
  •  伪装坚强ぢ
    2021-02-01 14:54

    You can do this via bash and open a ssh tunnel make the file structure you need to make then rsync the data. Will these temp folders change each time this sync is done? eg is it for each day of the week?

    ssh user@address
    mkdir -p tmp/fol1
    rsync avz /tmp/fol1/fol2/fol3/foln user@addr:/tmp/fol1/fol2/fol3/foln
    fi
    

提交回复
热议问题