使用7z打包本地文件, 並使用 scp上傳腳本

@echo off
set path=%SystemRoot%\system32;%SystemRoot%;%ProgramFiles%\7-zip
set host=10.33.44.110
set tempdir=C:\CIM\tmp_trans

move C:\CIM\QMR\*.xml %tempdir%

if exist %tempdir%\XML-archive.tar.xz (
    7z e %tempdir%\XML-archive.tar.xz -o%tempdir%
    del /q %tempdir%\XML-archive.tar.xz
)

7z a -sdel -ttar %tempdir%\XML-archive.tar %tempdir%\*.xml
7z a -sdel -txz  %tempdir%\XML-archive.tar.xz %tempdir%\XML-archive.tar
   
ping -n 1 "%host%" | findstr /r /c:"[0-9]*ms"

if %errorlevel% == 0 (
   "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console /script="C:\Program Files (x86)\WinSCP\5-xml-use-7z-archive-and-update.sh"
) else (
   echo PA server: %host% network PING Failure.
   echo ..
rem   echo ...Waiting for 5 min, end this process.
rem   ping 127.0.0.1 -n 60 >nul
)
相關文章
相關標籤/搜索