Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
需要在远程服务器usint ant中创建文件夹_Ant_Scp - Fatal编程技术网

需要在远程服务器usint ant中创建文件夹

需要在远程服务器usint ant中创建文件夹,ant,scp,Ant,Scp,使用ant scp,我可以将文件从本地系统(windows)复制到服务器(linux)。因此,我需要的是在系统日期之前使用ant在linux系统中的指定目录创建一个文件夹,并将文件复制到创建的文件夹中 这是我的ant脚本: <sshexec host="hostname:22" username="****" trust="true" password="fcubs" command="mkdir $/home/desktop/<folder to be cre

使用ant scp,我可以将文件从本地系统(windows)复制到服务器(linux)。因此,我需要的是在系统日期之前使用ant在linux系统中的指定目录创建一个文件夹,并将文件复制到创建的文件夹中

这是我的ant脚本:

<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>

请帮帮我
提前感谢

您可以使用这样的linux命令来创建目录:

export ATD=`date '+%h-%d-%Y_%H:%M:%S'` && cd /path/to/specified/dir && mkdir $ATD && cd $ATD
它将在dir/path/to/specified/dir中创建dir(例如)“Nov-14-2012\u 17:41:02”,并将cd刻录到其中

执行此命令后,只需将文件复制到目录即可