Kein Titel
@Echo off
rem #New: 18.01.2021/J.Fes JobMgr Script to organice UGII_SITE_DIR localy for the Job
rem #Doc: copy from %JobScripts_DP%\_CustomDefaults\UGII_SITE_DIR\#NXVer# startup and udo dir
rem #Exa: Call NXOrg_UGII_SITE_DIR.cmd NX0120 udoCMM

 if "%~1" neq "" set UGII_SITE_DIR_TP=%~1
 if "%~2" neq "" set UGII_SITE_DIR_UDO_TP=%~2

 rem defines local UGII_SITE_DIR
 set UGII_SITE_DIR_S_DP=%JobScripts_DP%\_CustomDefaults\UGII_SITE_DIR\%UGII_SITE_DIR_TP%
 set UGII_SITE_DIR_D_DP=%UGII_SITE_DIR%
 call Parse_Absolut_DP.cmd UGII_SITE_DIR_D_DP "%CmdCurRoot_DP%\..\_UGII_SITE_DIR\%UGII_SITE_DIR_TP%\"
 set UGII_SITE_DIR=%UGII_SITE_DIR_D_DP%

                                 Call :UgII_GetLocal "STARTUP" "startup"                "startup" UGII_SITE_DIR_STARTUP_S_DP UGII_SITE_DIR_STARTUP_D_DP
 if defined UGII_SITE_DIR_UDO_TP Call :UgII_GetLocal "UDO"     "%UGII_SITE_DIR_UDO_TP%" "udo"     UGII_SITE_DIR_UDO_S_DP     UGII_SITE_DIR_UDO_D_DP
 goto :eof

rem --------------- SUBROUTINES ------------------------------------------------
:UgII_GetLocal
 set UgII_GetLocal_TXT=%~1
 set TP_S=%~2
 set TP_D=%~3
 set UgII_GetLocal_S_DP=%UGII_SITE_DIR_S_DP%\%TP_S%
 set UgII_GetLocal_D_DP=%UGII_SITE_DIR_D_DP%\%TP_D%

 set %4=%UgII_GetLocal_S_DP%
 set %5=%UgII_GetLocal_D_DP%

 rem -- #Doc: ERROR Handel
 if not exist "%UgII_GetLocal_S_DP%" call ErrorHandel "S" "UGII_SITE_DIR source %UgII_GetLocal_TXT% %UgII_GetLocal_S_DP%" "dnf:Cannot find Dir:[%UgII_GetLocal_S_DP%]"

 set NXOrg_UGII_SITE_DIR_log_DPNE=%CmdCurRoot_DP%\zzNXOrg_UGII_SITE_DIR_log.txt
 set robocopy_opt=/R:5 /W:1 /xf *.bak *.tmp ~*.* /mir /E /TEE /Log+:"%NXOrg_UGII_SITE_DIR_log_DPNE%"

 Call Echo "UGII_SITE_DIR get SubDir........: %UgII_GetLocal_TXT%"
 Call Echo "UGII_SITE_DIR from server.......: %UgII_GetLocal_S_DP%"
 Call Echo "UGII_SITE_DIR to local..........: %UgII_GetLocal_D_DP%"
 robocopy "%UgII_GetLocal_S_DP%" "%UgII_GetLocal_D_DP%" "*.*" %robocopy_opt%

 if /i "%JobMgr_Debug%" neq "ON" goto :JumbOverDebug
  call Echo "---------------------------------------------------------------------------"
  call Echo "#Debug..........................: NXOrg_UGII_SITE_DIR:%UgII_GetLocal_TXT%"
  call Echo "#see log........................: %NXOrg_UGII_SITE_DIR_log_DPNE%"
  Call Echo "----  ----  ----  ----  ----  ----  ----  ----  ----  ----  ----  ----  ----"
  call Echo "Content in source dir...........: %UgII_GetLocal_S_DP%"
  Dir "%UgII_GetLocal_S_DP%"
  call Echo "Content in desitination dir.....: %UgII_GetLocal_D_DP%"
  Dir "%UgII_GetLocal_D_DP%"
  pause
 :JumbOverDebug

goto :eof
