Ant: scp create directory if not exist

前端 未结 2 1956
猫巷女王i
猫巷女王i 2021-01-21 18:17

I am using this to copy from A to B. But if for example the folder /config doesnt exist it gives me an exception. How can I solve it? I tried mkdirs=\"true\" but it runs to erro

2条回答
  •  不知归路
    2021-01-21 19:02

    You can use sshexec to create directories tree on remote machine before coping. mkdir -p creates directories if not exists. (How to mkdir only if a dir does not already exist?)

    
    

    Add it to your target before scp

提交回复
热议问题