使用 ant scp 我可以将文件从本地系统(windows)复制到服务器(linux)。所以我需要的是我想在 linux 系统的指定目录中使用 ant 和复制按系统日期创建一个文件夹文件到创建的文件夹..
这是我的 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
它将在目录/path/to/specified/dir 中创建目录(例如)“Nov-14-2012_17:41:02”并将 cd 到它。
执行此命令后,您只需将文件复制到目录即可。
关于ant - 需要使用 ant 在远程服务器中创建一个文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6367856/