@echo off title *** SyncOldPhotos.bat by -JpE- 20230212010002 *** :: TestsNOTwell Simplified to a folder or computer. Oh well. set ace="\\DADDIO-PC\Daddio_Older_Photos\125 NASA Pictures (Illuminati, Freemasons)\ace1.jpg" :: set bats=C:\Users\%username%\Documents\AAA Sync2Laptop\Batch Files\BCS-Suite :: if exist %fileo% goto start :: If ^ not AAA calling, set time var to now: set timethen=%time% set datethen=%date% set fileo="%bats%\caller_check.txt" set RunT="%bats%\runtime_display.bat" :: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :start set /a sup=0 set /A dad=0 set /A bup=0 :restart set ver=v7.9.9.47 20230515015522 by -JpE- set /A aok=0 echo . echo . :: set b1=**************************************************************** set b2=** ****************************************************** ** set b3=*** *** *** *** *** **** *** *** *** *** *** echo %b1% echo %b3% echo %b1% echo ** * * * ** echo ** **** * Custom Software by JpE * **** ** echo ** * * * ** echo %b2% echo ** ** Adapted 20210421021349 SyncOlderPhotos.bat ** ** echo %b2% REM echo %b2% REM echo ** ** echo ** Run from the JpE Side Only now. 20220420042022 ** REM echo ** ** echo %b2% echo ** %ver% ** echo %b1% echo %b3% echo %b2% echo ** Syncing older photos with Daddio and running backups. ** :: echo %b1% echo ** Today is %datethen% and It is now %timethen% ** echo %b1% if %bup% gtr 0 goto externals if %sup% gtr 0 goto externals if not exist %ace% goto skipit :: Daddio is Online echo ** Please wait. Bringing in Older_Photos from Daddio. ** echo %b1% :: set source0="\\DADDIO-PC\Daddio_Older_Photos" set destin0="D:\Older_Photos" :: ***************************************************************** xcopy %source0% %destin0% /D /E /V /C /F /G /R /K /Y /B :: ***************************************************************** echo %b1% echo ** Today is %date% and It is now %time% ** echo %b1% if %errorlevel% equ 0 set /A aok+=1 if %errorlevel% neq 0 goto skipit echo ** Daddio is Online! Now Syncronizing... ** echo %b2% set task=Tasks if %aok% equ 1 set task=Task echo ** %aok% %task% Completed: %destin0% Brought in. ** echo %b1% echo ** Please wait while we Sync back to Daddio... ** echo %b1% set destin1="\\DADDIO-PC\Daddio_Older_Photos" xcopy %destin0%"\"*.* %destin1% /D /E /V /C /F /G /R /K /Y /B echo %b1% echo ** Today is %date% and It is now %time% ** echo %b2% if %errorlevel% equ 0 set /A aok+=1 if %errorlevel% neq 0 goto skipit ::: was if %aok% equ 2 ^^^^ set task=Tasks if %aok% equ 1 set task=Task echo ** %aok% %task% completed: Pics Synced to DADDIO. ** echo %b1% echo ** Now Syncing to Externals if available. ** :skipit if %aok% neq 0 goto externals echo ** DADDIO is NOT Online Right Now. ** set /A dad+=1 goto retry :externals echo %b1% set source1="D:\Older_Photos" set destin2="X:\%username%-PC\Older_Photos" set destin3="I:\Older_Photos" set destin4="H:\Older_Photos" set destin5="R:\Older_Photos" set /A which=0 if exist %destin2% set /A which+=1 if exist %destin3% set /A which+=2 if exist %source1% set /a which+=4 if exist %destin4% set /a which+=8 if exist %destin5% set /a which+=16 if %which% lss 4 echo ** Older Photos Source drive is currently Offline. ** if %which% lss 4 set /a sup+=1 if %which% lss 4 goto retry if exist %destin2% goto backup if exist %destin3% goto backup if exist %destin4% goto backup if exist %destin5% goto backup :: NOTE: Doesn't return here in this language so this is okay. echo ** No backup drives are currently Online. ** set /A bup+=1 :retry if %sup% gtr 7 goto ending if %bup% gtr 3 goto ending if %dad% gtr 3 goto externals :: Can't default to Yes or it would hang below foreverafter. set msg="** Bring it online and try again? (y\N): " choice /c yn /n /t 15 /d n /m %msg% if %errorlevel% gtr 1 if %bup% gtr 0 goto ending if %errorlevel% gtr 1 if %sup% gtr 1 goto ending if %errorlevel% gtr 1 goto externals echo ** Press any key when ready to try again. ** echo %b1% echo ** pause ::: Programmatic pause for user action. echo ** echo %b1% goto restart :::::::::::::::::::::::::::::::::::::::::::::::::::: ::: reusable function saves on redundant code ::: ::: line 2 is just in case something slips past. ::: :::::::::::::::::::::::::::::::::::::::::::::::::::: :copy2