Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::: RC7
- :start
- @echo off
- set timethen=%time%
- set datethen=%date%
- if not defined vers set vers=v8.7.0.09 20231106063912 by -JpE-
- set ttl=** Auto Rapid Backup of/by JpE: LAUNCHED %datethen% @ %timethen% **
- set /a exit2=0
- :: exit2 ^ var for processes to flag an exception or redirection.
- set bats=C:\Users\%username%\Documents\AAA Sync2Laptop\Batch Files\BCS-Suite
- REM set util1="%bats%\utility1.bat"
- :restart
- title %ttl%
- set mstr=** Master-Program - Maintenance Ultra Deluxe Pro 8 **
- set filename2="%bats%\overrider3.txt"
- set /a override1=0
- if exist %filename2% set /a override1=1 & del /f /s /q %filename2%
- REM echo . & echo override1 == %override1% & echo . & pause & echo . & exit
- if %override1% equ 0 cls
- echo .
- echo .
- ::
- ::::::::::::::::::::::::::::::::::
- :::::::: Global Variables ::::::::
- ::::::::::::::::::::::::::::::::::
- ::
- :: Set Alias for Long Line, Short Line, Docs & LogFile.
- set sl= /*\/*\/*\/*\/*\/*\/*\/*\/*\/*\/*\/*\/*\/*\
- set l1=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
- set l2=\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
- ::
- set dir=C:\Users\%username%\Documents
- cd %dir%
- ::
- rem LOGs could BE DEVELOPED, FOR ALL MODULES.
- set lf="%dir%\AAA-Sync_LogFile.txt"
- :::::::::::::::::::::::::::::::::::::
- set smsg="%bats%\caller_check_showmsg.bat"
- set oldr="%bats%\SyncOlderPhotos.bat"
- set outs="%bats%\outlook_handler.bat"
- set sams="%bats%\phone_backups.bat"
- :: Actual Error Handling Routine (under dev)
- set errr="%bats%\ErrorHandling.bat"
- :: Rev 2 v7.9.2.36 adds: v testfile
- set fileo="%bats%\caller_check.txt"
- :: ^v these are predefined in SOP also.
- set exidos="%bats%\exit_main.bat"
- :: split out v7.9.4.42 20220921032112
- set copy="%bats%\copy_control.bat"
- :: Test file declaration.
- set test="D:\Copies\My Documents\AAA Sync2Laptop\good1.txt"
- set /a backout=0
- set /a samsung=0
- set /a wipe=0
- set /a r3v3rs3=0
- set /a clrphodest=0
- set /a clroutdest=0
- set /a code2=0
- echo %sl%
- echo *** Syncs Key Folders with ALL Copies! ***
- echo %sl%
- echo ** %vers% **
- echo %sl%
- echo .
- echo %l1%
- echo *** This will backup your Basic folders. ***
- echo %l1%
- ::
- if exist %fileo% call %smsg%
- if exist %fileo% del /f /s /q %fileo%
- REM echo . & echo override1 == %override1% & echo . & pause & echo .
- if %override1% neq 1 goto input
- set /a skiy=1
- set /a backout=1
- set /a clr=1
- set /a out=1
- set /a dest=1
- set /a full=2
- set /a samsung=1
- set /a clrphodest=2
- set /a olde=2
- set /a review=2
- echo .
- REM echo Made it to Here! & pause & echo . & exit
- goto control
- :::::::::::::::::::::::::::::::::[ USER INPUT ]:::::::::::::::::::::::
- :input
- echo .
- set msg="=*=*=*=> Is this a Rescue/Recovery Mission? (y/N): "
- choice /c yn /n /t 3 /d n /m %msg%
- if %errorlevel% equ 1 goto recover
- echo . & echo %l1% & echo .
- ::
- echo To make further prompting unneccessary and speed it up
- set msg="===> Shall we skip wipe of all destinations? (Y/n): "
- choice /c yn /n /t 15 /d y /m %msg%
- set skiy=%errorlevel%
- echo . & echo %l1% & echo .
- if %skiy% equ 1 goto lookout
- ::
- echo OR,
- set msg="Should we wipe every destination now online? (y/N): "
- choice /c yn /n /t 11 /d n /m %msg%
- echo . & echo %l1% & echo .
- if %errorlevel% equ 1 set skiy=3 & goto lookout
- ::
- set msg="Shall I just wipe the external Destinations? (Y/n): "
- ::: Won't wipe Q: it's setup as a catch-all.
- choice /c yn /n /t 11 /d y /m %msg%
- echo . & echo %l1% & echo .
- if %errorlevel% equ 1 set skiy=4
- :lookout
- set msg="=*=*=*=*=*=> Backup Outlook Files as well? (Y/n/c): "
- choice /c ync /n /t 7 /d y /m %msg%
- if %errorlevel% equ 3 goto exit3
- set /a backout=%errorlevel%
- ::
- if %backout% neq 1 goto phone
- echo .
- echo Outlook Files:
- set msg="*=*=*=*=*=> Clear the Outlook Backups first? (Y/n): "
- choice /c yn /n /t 7 /d y /m %msg%
- if %errorlevel% equ 2 goto phone
- :: And leave clroutdest==0 ^
- set /a clr=%errorlevel%
- :: == 1 ^ is now implicite
- echo .
- echo Outlook Files:
- set msg="=*=*=> Shall I also clear all backup drives? (Y/n): "
- choice /c yn /n /t 7 /d y /m %msg%
- set /a out=%errorlevel%
- :::::::::::::::::::::::::::::::::::::::::
- :: 0==wipe none
- :: 1==just backups on D:
- :: 2==all backup drives.
- :: 3==network systems also.
- :: 4==MAYBE full circle back to source?
- :::::::::::::::::::::::::::::::::::::::::
- echo .
- echo Outlook Files:
- set msg="> Shall we also clear all Networked Systems? (Y/n): "
- choice /c yn /n /t 7 /d y /m %msg%
- set /a dest=%errorlevel%
- echo .
- echo Outlook Files:
- set msg="*=*=*=> Shall WE MAKE IT A FULL CIRCLE SYNC? (y/N): "
- choice /c yn /n /t 7 /d n /m %msg%
- set /a full=%errorlevel%
- :phone
- echo .
- echo %l1%
- echo .
- ::
- set msg="=*=*=*=*=> Backup Samsung Backups as well? (Y/n/c): "
- choice /c ync /n /t 7 /d y /m %msg%
- if %errorlevel% equ 3 goto exit3
- set /a samsung=%errorlevel%
- if %samsung% neq 1 goto photos
- echo .
- echo Phone Backups:
- set msg=">Wipe all backup destinations now available? (y/N): "
- choice /c yn /n /t 7 /d n /m %msg%
- set /a clrphodest=%errorlevel%
- :photos
- echo .
- echo %l1%
- echo .
- ::
- set msg="==> Would you like to then check Old Photos? (y/N): "
- choice /c yn /n /t 12 /d n /m %msg%
- set /a olde=%errorlevel%
- echo .
- echo %l1%
- echo .
- ::
- set msg="==> Did you want to then Pause at the End? (y/N/c): "
- choice /c ync /n /t 19 /d n /m %msg%
- if %errorlevel% equ 3 goto exit3
- set /a review=%errorlevel%
- echo .
- :::::::::::::::::::::::::::[ MAIN BODY ]:::::::::::::::::::::::::::::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: NOTE: backup Playlists, Desktop, Documents, Photos,
- :: Favorites & Downloads :: Only Restores Source from D:\
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :control
- if not exist %copy% echo .
- if not exist %copy% echo %sl%
- if not exist %copy% echo *** Ctrl Program NOT Found. ***
- if not exist %copy% echo %sl%
- if not exist %copy% echo .
- if not exist %copy% goto outlook
- ::
- set /a sgnl=0
- call %copy%
- ::
- if %sgnl% equ 2 goto exit3
- :: V7.9.7.xx rote mods
- if %sgnl% equ 5 goto recover
- if %sgnl% equ 4 if exist %test% goto start
- if %sgnl% neq 4 goto outlook
- echo .
- echo %sl%
- echo **** Dummy forgot to Unlock D: ****
- echo %sl%
- echo .
- set msg="Try again to update D: (Y/n)? "
- choice /c ynoc /n /t 300 /d o /m %msg%
- if %errorlevel% equ 1 goto start
- if %errorlevel% equ 3 pause
- if %errorlevel% equ 4 goto exit3
- goto outlook
- :::::::::::::::::::::::::::::::::::::::::::
- :: Recovery Restores Sources from Copies ::
- :::::::::::::::::::::::::::::::::::::::::::
- :recover
- echo .
- echo %sl%
- echo ** ******** **
- echo *** -WARNING!- ***
- echo ***** You are on the road to Recovery! *****
- echo *** -WARNING!- ***
- echo ** ******** **
- echo %sl%
- echo .
- echo %l1%
- echo .
- set msg="*=*=*=*=*=> Recopy Destinations to Sources? (y/N): "
- choice /c yn /n /t 45 /d n /m %msg%
- if %errorlevel% neq 1 goto start
- set /a r3v3rs3=2
- goto control
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Sync Outlook with D: && I: && X: && Daddio when available. ::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :outlook
- set /a exit2=0
- if %backout% neq 1 goto exit1
- :: exit2 var is used in called processes to flag an exception.
- set nf=could not be found.
- if not exist %outs% echo The Outlook "Handler Program" %nf%
- if not exist %outs% echo ****
- if not exist %outs% echo %outs%
- if not exist %outs% goto exit1
- ::
- call %outs%
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: *** Tasks Completed, Main Program Exiting *** ::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- title %mstr%
- if %exit2% gtr 0 goto exit2
- :exit1
- echo %l2%
- echo ** Computer Backups Completed Successfully! **
- echo %l2%
- :: But only after backing up my phone backups.
- :exit2
- if %r3v3rs3% equ 2 goto exit3
- if %samsung% neq 1 goto exit0
- if exist %sams% call %sams%
- ::
- if %exit2% neq 0 goto exit0
- echo .
- echo %sl%
- echo *** Victoria Backup is Backed Up! ***
- echo %sl%
- echo .
- :exit0
- if %olde% neq 1 goto exit3
- if not exist %oldr% goto exit3
- if exist %smsg% call %smsg%
- echo .
- if not exist %fileo% copy /a /v /y %errr%,%fileo%
- ::
- :::::::::::::::
- set /a exit2=0
- call %oldr%
- :::::::::::::::
- ::
- if %exit2% neq 0 goto exit3
- echo .
- echo %l2%
- echo ** Old Photos Synced up to date! %date% @ %time% **
- echo %l2%
- REM echo .
- :exit3
- set /a exit2=0
- if exist %exidos% call %exidos%
- :: See: exit_main.bat for more info.
- if %exit2% equ 4 goto restart
- exit /b %errorlevel%
- :: 100% -JpE-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement