linuxスクリプト:jarパッケージを一括アップロードダウンロード

4582 ワード

@echo off
::download 
:: Run SFXCL - downlaod .jar files from remote to local folder:
echo.Prepare to download the jar package from sit,please wait.....
sfxcl /S "10.202.107.24_TW_  "  /app/runtime/lib/*.jar   E:\JarPackage\ >nul 2>&1

::check the download status.
if %errorlevel% == 0 (goto SUCCESS) else (goto FAILURE)

:SUCCESS
echo.the jar package downloaded successfully.
::set /p upload=Do you want to continue upload,please choose Y or N: 
set upload=Y
if NOT %upload%==Y (goto END) else (goto UPLOAD) 

:FAILURE
echo.Transfer Failure.
goto END


:UPLOAD
::Check if the server directory exists
if not exist E:\JarPackage\196.168.1.211\ md E:\JarPackage\196.168.1.211\ >nul 2>&1
if not exist E:\JarPackage\196.168.1.212\ md E:\JarPackage\196.168.1.212\ >nul 2>&1
if not exist E:\JarPackage\196.168.1.213\ md E:\JarPackage\196.168.1.213\ >nul 2>&1
if not exist E:\JarPackage\196.168.1.214\ md E:\JarPackage\196.168.1.214\ >nul 2>&1
if not exist E:\JarPackage\196.168.1.215\ md E:\JarPackage\196.168.1.215\ >nul 2>&1
if not exist E:\JarPackage\196.168.1.216\ md E:\JarPackage\196.168.1.216\ >nul 2>&1

::Copy the packages to their respective directories


echo.The files is being copied,please wait.....
for  %%i in (
aff-cache-1.0-SNAPSHOT.jar 
aff-convert-1.0-SNAPSHOT.jar 
aff-eureka-1.0-SNAPSHOT.jar 
aff-invoice-1.0-SNAPSHOT.jar 
aff-system-1.0-SNAPSHOT.jar) do (
copy /y %%i E:\JarPackage\196.168.1.211\ >nul 2>&1
copy /y %%i E:\JarPackage\196.168.1.212\ >nul 2>&1)

for  %%i in (
aff-config-1.0-SNAPSHOT.jar 
aff-difference-1.0-SNAPSHOT.jar 
aff-gather-1.0-SNAPSHOT.jar 
aff-handAdjustment-1.0-SNAPSHOT.jar 
aff-incomeAndPayment-1.0-SNAPSHOT.jar ) do (
copy /y %%i E:\JarPackage\196.168.1.213\ >nul 2>&1
copy /y %%i E:\JarPackage\196.168.1.214\ >nul 2>&1)

for  %%i in (
aff-basicdata-1.0-SNAPSHOT.jar 
aff-pull-1.0-SNAPSHOT.jar 
aff-report-1.0-SNAPSHOT.jar 
aff-tally-1.0-SNAPSHOT.jar 
aff-webservice-1.0-SNAPSHOT.jar 
aff-zuul-1.0-SNAPSHOT.jar ) do (
copy /y %%i E:\JarPackage\196.168.1.215\ >nul 2>&1 
copy /y %%i E:\JarPackage\196.168.1.216\ >nul 2>&1)

echo.the files copy is completed.
pause
echo.Prepare to upload the jar package to the UAT,please wait.....

:: Run SFXCL - upload .jar files from local to remote folder:
sfxcl  E:\JarPackage\196.168.1.211\*.jar  /S "196.168.1.211"  /home/sfapp/ >nul 2>&1
::check the jar package upload status.
if %errorlevel% == 0 (
echo.The jar package upload to server 196.168.1.211 successful.) else (
echo.The jar package upload to server 196.168.1.211 failure.)


:: Run SFXCL - upload .jar files from local to remote folder:
sfxcl  E:\JarPackage\196.168.1.212\*.jar  /S "196.168.1.212"  /home/sfapp/ >nul 2>&1
::check the jar package upload status.
if %errorlevel% == 0 (
echo.The jar package upload to server 196.168.1.212 successful.) else (
echo.The jar package upload to server 196.168.1.212 failure.)


:: Run SFXCL - upload .jar files from local to remote folder:
sfxcl  E:\JarPackage\196.168.1.213\*.jar  /S "196.168.1.213"  /home/sfapp/ >nul 2>&1
::check the jar package upload status.
if %errorlevel% == 0 (
echo.The jar package upload to server 196.168.1.213 successful.) else (
echo.The jar package upload to server 196.168.1.213 failure.)


:: Run SFXCL - upload .jar files from local to remote folder:
sfxcl  E:\JarPackage\196.168.1.214\*.jar  /S "196.168.1.214"  /home/sfapp/ >nul 2>&1
::check the jar package upload status.
if %errorlevel% == 0 (
echo.The jar package upload to server 196.168.1.214 successful.) else (
echo.The jar package upload to server 196.168.1.214 failure.)


:: Run SFXCL - upload .jar files from local to remote folder:
sfxcl  E:\JarPackage\196.168.1.215\*.jar  /S "196.168.1.215"  /home/sfapp/ >nul 2>&1
::check the jar package upload status.
if %errorlevel% == 0 (
echo.The jar package upload to server 196.168.1.215 successful.) else (
echo.The jar package upload to server 196.168.1.215 failure.)


:: Run SFXCL - upload .jar files from local to remote folder:
sfxcl  E:\JarPackage\196.168.1.216\*.jar  /S "196.168.1.216"  /home/sfapp/ >nul 2>&1
::check the jar package upload status.
if %errorlevel% == 0 (
echo.The jar package upload to server 196.168.1.216 successful.) else (
echo.The jar package upload to server 196.168.1.216 failure.)

:END
echo.Press any key to exit this script execute.
pause>nul