简体   繁体   English

在Windows中通过FTP下载文件(从Linux到Windows)后如何运行批处理文件

[英]How to run batch file after file download (from Linux to Windows) throught FTP in Windows

I am doing file copy from Linux to Windows share through FTP. 我正在通过FTP将文件从Linux复制到Windows共享。

Once copy is done I am moving it to isilon storage which is shared on network path (manually). 复制完成后,我将其移动到在网络路径上共享的isilon存储(手动)。

Now I have created a batch file, which will do copy from FTP shared path to network path. 现在,我已经创建了一个批处理文件,它将从FTP共享路径复制到网络路径。

So how can I start batch file after FTP download? 那么,FTP下载后如何启动批处理文件? How can I automate it completely? 如何完全自动化?

from Linux 从Linux

ftp -n ip
user "user" "pwd"
put app.tar.gz

Once it is done i want to move it network shared path 一旦完成,我想将其移动到网络共享路径

Just use the copy command in a batch file, after the ftp.exe finishes: ftp.exe完成后,只需在批处理文件中使用copy命令:

ftp.exe -s:download.txt
copy c:\dowloadtarget\myfile.txt \\server\share\target\myfile.txt

You can run the copy even from the FTP script (the download.txt ), if you need it for some reason. 如果出于某些原因需要,甚至可以从FTP脚本( download.txt )运行该副本。 Use the ! 使用! (escape to shell) command. (转义至shell)命令。

get /remote/path/myfile.txt c:\dowloadtarget\myfile.txt
! copy c:\dowloadtarget\myfile.txt \\server\share\target\myfile.txt

But why don't you download the file directly to the shared folder? 但是,为什么不将文件直接下载到共享文件夹?

get /remote/path/myfile.txt \\server\share\target\myfile.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM