环境:windows上代码路径下存放:WinSCP-5.13.8-Setup.exe
第一步:test.txt 拉取脚本的txt文本
解析:存放从linux路径下拉取所需源文件zyy_count.result
到本地windows的目标路劲改下:D:zyyXNresult
option echo off
option batch on
option confirm off
open scp://root:Uxsino_test@192.168.1.122
cd /home/zyy#进入linux的源文件路径
get zyy_cpu_mem.result D:zyyXNresult
get zyy_count.result D:zyyXNresult
open scp://root:Uxsino_test@192.168.1.122
cd /home/simo
get simo_cpu_mem.result D:SIMOXNresult121
get simo_count.result D:SIMOXNresult121
option transfer binary
option synchdelete off
close
exit
第二步:主程序将移动脚本文件通过winscp.exe工具移动
move.bat
解析:通过winscp.exe执行上面的test.txt的脚本文件
并将执行日志存放到 /log=D:SIMOXNresultlog.txt
@echo off
start /d "D:profileWinSCP" WinSCP.exe /y /console /script=D:SIMOXNresult est.txt /log=D:SIMOXNresultlog.txt
set /a "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
move D:SIMOXNresultsimo_count.result "D:SIMOXNresultsimo_count.result%Ymd%"
move D:SIMOXNresultsimo_cpu_mem.result "D:SIMOXNresultsimo_cpu_mem.result%Ymd%"
move D:SIMOXNresult122simo_cpu_mem.result "D:SIMOXNresult122simo_cpu_mem.result%Ymd%"
move D:SIMOXNresult122simo_count.result "D:SIMOXNresult122simo_count.result%Ymd%"
第三步:设置windows自带的计划任务 执行 move.bat脚本