Is there a way except the sshexec
task to do this? I know that you can copy files with the scp
task. However, I need to do additional things like check if some folders are there then delete them. I would like to use something like the condition
task and delete
task for this. For now I have set it up with the sshexec
task. But this will most likely not work on a Windows server. And to do something like check if a directory is there and delete it I would have to write a script instead using ant tasks (for now I expect that the directory which should be deleted is actually there which I don't like because when it's missing my sshexec
task will interrupt). Thanks in advance for any help.
views:
201answers:
1
+1
A:
yes you can use sshexec. The docco describes how to do it: http://ant.apache.org/manual/OptionalTasks/sshexec.html
For example:
<sshexec host="somehost"
username="dude"
password="yo"
command="touch somefile"/>
you can use the command attribute to call a shell script on the remote host that will do your checks and deletes as i'm not sure if you can have multiple commands in the command attribute, plus it would get a bit messy that way.
HTH
simonlord
2010-03-10 10:53:43
kukudas
2010-03-10 10:58:05