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
It's not possible to create remote directories with scp task.
Here's a macrodef for scptransfer, that does all the work needed for transfer
from a given stagedirectory => fix linefeeds, createremote, deleteremote, fail if stagedir empty ... etc.
Macrodef is using ant addon Flaka, if you don't need all that bells and whistles, simply use sshexec task with mkdir -p
before scp to create your remote targetdir.
=============== SCP Transfer ===============
Project = ${project}
Environment = ${env}
UserID = @{userid}
Targetserver = @{host}
Targetpath = @{remotedir}
fixLF ? = @{fixLF}
createremote ? = @{createremote}
deleteremote ? = @{deleteremote}
#{@{deleteremote} ? 'deleteincludes = @{deletecincludes}' : '' }
Stagedir = @{stagedir}
stageincludes = @{stageincludes}
stageexcludes = @{stageexcludes}
=============== SCP Transfer ===============
=============== SCP Transfer =============
Skip => NO StageDirContents !!
=============== SCP Transfer =============
As we switched to Github only recently get the manual here and some examples here.