zoukankan      html  css  js  c++  java
  • 定时从linux获取信息放到windows上

    环境: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脚本

  • 相关阅读:
    bat学习
    Eclipse调试方法及快捷键
    JDK中的设计模式
    开源-自由-乔布斯
    AOP
    编程语言
    [LeetCode] 160. Intersection of Two Linked Lists(两个单链表的交集)
    [LeetCode] 198. House Robber(小偷)
    [LeetCode] 155. Min Stack(最小栈)
    [LeetCode] 1. Two Sum(两数之和)
  • 原文地址:https://www.cnblogs.com/zyy98877/p/10953461.html
Copyright © 2011-2022 走看看