| ... | ... | @@ -130,4 +130,51 @@ if not exist "%SOURCE%" ( |
|
|
|
:: Target already exists? Skip copy
|
|
|
|
if exist "%TARGET%" (
|
|
|
|
echo 💡 Found existing cache at %TARGET%. Skipping copy.
|
|
|
|
echo |
|
|
\ No newline at end of file |
|
|
|
echo (Delete the folder to force resync)
|
|
|
|
echo.
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
|
|
|
:: Copy with robocopy (reliable + retry + verify)
|
|
|
|
echo 📦 Copying files with verification...
|
|
|
|
robocopy "%SOURCE%" "%TARGET%" /E /COPYALL /R:1 /W:1 /XJ /LOG+:"%BASE_DIR%\robocopy.log" >nul
|
|
|
|
|
|
|
|
:: Check result (robocopy returns 0-7 for success)
|
|
|
|
set RC=%ERRORLEVEL%
|
|
|
|
if %RC% GTR 7 (
|
|
|
|
echo ❌ Error copying %NAME% cache. Check %BASE_DIR%\robocopy.log
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
|
|
|
|
:: Verify file counts match
|
|
|
|
for /f "tokens=1" %%a in ('dir "%SOURCE%" /a-d /s ^| find "File(s)"') do set COUNT1=%%a
|
|
|
|
for /f "tokens=1" %%a in ('dir "%TARGET%" /a-d /s ^| find "File(s)"') do set COUNT2=%%a
|
|
|
|
|
|
|
|
:: Remove commas from numbers
|
|
|
|
set COUNT1=%COUNT1:,%
|
|
|
|
set COUNT2=%COUNT2:,%
|
|
|
|
|
|
|
|
echo 📊 Files: Source=%COUNT1%, Target=%COUNT2%
|
|
|
|
|
|
|
|
if "%COUNT1%"=="%COUNT2%" (
|
|
|
|
echo ✅ Verified: %NAME% cache copied successfully!
|
|
|
|
) else (
|
|
|
|
echo ⚠️ Warning: File count mismatch. Some files may not have copied.
|
|
|
|
echo You may want to run this script again or check disk space.
|
|
|
|
)
|
|
|
|
|
|
|
|
echo.
|
|
|
|
exit /b
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
✅ **Copy and paste this block directly** — it continues cleanly from the `:migrate_dir` function and completes the full script.
|
|
|
|
|
|
|
|
Let me know when you're ready for:
|
|
|
|
- The **cleanup companion script** (`clean-c-drive.bat`)
|
|
|
|
- Or the **run-time redirect version** (no symlinks, just env vars)
|
|
|
|
|
|
|
|
You’ve got this. And hey — you're not just fixing space.
|
|
|
|
You're **taking back control**. 💻✨ |
|
|
\ No newline at end of file |