-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModSync.bat
More file actions
60 lines (44 loc) · 1.57 KB
/
ModSync.bat
File metadata and controls
60 lines (44 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@echo off
setlocal enabledelayedexpansion
:: ===========================================================
:: NEBIRRS LAB - VALHEIM MODSYNC (PRO EDITION)
:: Logic: Version 1.1 | Author: Marcel Soelter
:: ===========================================================
set "CONFIG=config.ini"
echo [SYSTEM] Loading configuration from %CONFIG%...
if not exist "%CONFIG%" (
echo [ERROR] %CONFIG% was not found!
echo Please ensure the config file is in the same directory as this script.
pause
exit /b
)
for /f "tokens=1,2 delims==" %%A in ('findstr /b "SOURCE_DIR DEST_DIR BLACKLIST" "%CONFIG%"') do (
set "%%A=%%B"
)
call set "SOURCE_DIR=%SOURCE_DIR%"
call set "DEST_DIR=%DEST_DIR%"
echo [CHECK] Verifying paths...
if not exist "%SOURCE_DIR%" (
echo [ERROR] Source path not found: %SOURCE_DIR%
goto :EXIT
)
if not exist "%DEST_DIR%" (
echo [ERROR] Destination path not found: %DEST_DIR%
echo [TIP] Is your network drive mounted or the server reachable?
goto :EXIT
)
echo -----------------------------------------------------------
echo [START] Synchronization Active
echo Source: %SOURCE_DIR%
echo Target: %DEST_DIR%
echo Skip: %BLACKLIST%
echo -----------------------------------------------------------
robocopy "%SOURCE_DIR%" "%DEST_DIR%" /MIR /XO /Z /XD %BLACKLIST% /R:3 /W:5 /TEE /LOG:"sync_log.txt"
if %ERRORLEVEL% GEQ 8 (
echo [ERROR] Critical errors occurred during sync. Check sync_log.txt
) else (
echo [SUCCESS] Synchronization completed successfully.
)
:EXIT
echo -----------------------------------------------------------
pause