简体   繁体   中英

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.

Once copy is done I am moving it to isilon storage which is shared on network path (manually).

Now I have created a batch file, which will do copy from FTP shared path to network path.

So how can I start batch file after FTP download? How can I automate it completely?

from 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 -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. Use the ! (escape to shell) command.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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