You must create a folder on the remote usint ant server

using ant scp, I can copy the file from the local system (windows) to the server (linux). I need that I want to create a folder by the system date in the specified directory on the Linux system using ant and copy the file to the created folder.

this is my ant script:

<sshexec host="hostname:22" username="****" trust="true"
     password="fcubs" 
     command="mkdir $/home/desktop/<folder to be creted here>"/>
   <scp todir="username@hostname:/home/desktop" password="*****" trust="true">
      <fileset dir="D:\kkk"/>
   </scp>

Help me in advance thanks

+3
source share
1 answer

you can use a linux command that creates a directory:

export ATD=`date '+%h-%d-%Y_%H:%M:%S'` && cd /path/to/specified/dir && mkdir $ATD && cd $ATD

it will create a dir (for example) " Nov-14-2012_17: 41: 02 " in the directory dir / path / to / specified / dir and will be connected to it.

after executing this command, you can simply copy the file to a directory.

0
source

All Articles