GlobalAccessSoftware

copy_backups.bat

Nov 16th, 2023
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.87 KB | Software | 0 0
  1.  
  2.  
  3. ::::::::::::::::::::::::::::::::::::::::::::::
  4. ::   This MoFo is "Some" Super-Workhorse!   ::::::
  5. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  6. :: Made Generic Enough to Handle all instances of folders to backup. ::
  7. :: v7.9.7.73 20221108210854 by -JpE- for Global Access Computers!    ::
  8. :: Backs up Documents, Pictures, Favorites, DLs and Desktop.         ::
  9. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10.  
  11. ::: RC8
  12.  
  13. ::copies
  14. @echo off
  15. set /a code2=0
  16. set /a exit2=0
  17. set /a w=0
  18. set ttl1= ***** %oper% Backups Ultra Pro Deluxe
  19. set ttl2= *****
  20. title %ttl1%%ttl2%
  21.  
  22. set default=Documents
  23.   if not defined vers set vers=v8.5.5.67 20230630032014 by -JpE-
  24. set ext0=just_externals.bat
  25. set ext1="%bats%\%ext0%"
  26. :: Those ^ 2 used in...
  27. set getw="%bats%\get_wipe_prefs.bat"
  28. set ext2="%bats%\copy_externals.bat"
  29. set notonline="%bats%\not_online.bat"
  30. set status="%bats%\status_report.bat"
  31. set spcn=
  32.  
  33. if %oper% NEQ %default% goto skip
  34.  
  35. echo %l2%
  36. echo .
  37. echo %sl%
  38. echo          **  "Copier"  Backup-Pro Ultra Deluxe   **
  39. echo          **  %vers%   **
  40. echo %sl%
  41. echo .
  42. echo %l2%
  43. echo .
  44. echo %sl%
  45. echo                   %date% @ %time%
  46. echo %sl%
  47. echo .
  48.  
  49.  
  50. :skip
  51. echo %l2%
  52. echo .
  53. echo %sl%
  54.  
  55. :: restore Swaps source & destination & skips externals.
  56. if %r3v3rs3% neq 2 goto backup
  57.  
  58. :: else swapfest, it's a Restore TASK!
  59. set txt=%src%
  60. set src=%cps%
  61. set cps=%txt%
  62.  
  63. :: Source C: not found exception.
  64. if not exist %src% set /a w=5
  65. if %w% equ 5 call %notonline%
  66. if %w% equ 5 goto return
  67. :: So source not exist is HANDLED!
  68.  
  69.  
  70. :backup
  71. set nop=is NOT Online.
  72. set ol1=is now Online.
  73.  
  74. :: src is doc source folder on C: (w==5 if not found)
  75. set fld=%src%
  76. if exist %status% call %status%
  77. :: if not exist src already handled above.
  78.  
  79. :: cps is copies folder on D: (w==4 if not found)
  80. set fld=%cps%
  81. if exist %status% call %status%
  82.  
  83. ::::::::::::::::::::::::::::::::::
  84. :: GET STATUS OF EXTERNAL DRIVES
  85. ::::::::::::::::::::::::::::::::::
  86. :: bk1 is I: (w==1 if not found)
  87. set fld=%bk1%
  88. if exist %status% call %status%
  89. REM if not exist %fld% set /a w=1
  90.  
  91. :: bk2 is X: (w==2 if not found)
  92. set fld=%bk2%
  93. if exist %status% call %status%
  94. REM if not exist %fld% set /a w=2
  95.  
  96. :: bk3 is H: (w==3 if not found)
  97. set fld=%bk3%
  98. set spcn=        
  99. if exist %status% call %status%
  100. REM if not exist %fld% set /a w=3
  101.  
  102. :: bk4 is U: NEW not sure about w yet.
  103. set fld=%bk4%
  104. set spcn=
  105. if exist %status% call %status%
  106. rem end construction
  107.  
  108. echo %sl%
  109. echo .
  110.  
  111. if not exist %cps% set /a w=4
  112. if %w% equ 4 call %notonline%
  113.  
  114. set txt=Backup
  115. if %r3v3rs3% equ 2 set txt=Restore
  116. echo %l1%
  117. echo .
  118. echo %sl%
  119. echo            ***  %oper% %txt% Underway...   ***
  120. echo %sl%
  121. echo .
  122. echo %l1%
  123. echo %time%
  124. echo .
  125.  
  126. ::: Don't wipe anything:
  127. if %skiy% equ 1 set wipe=0
  128. if %skiy% equ 1 goto sky1
  129.  
  130. ::: Just wipe externals, but rem Q: is setup
  131. ::: as a catchall and so it don't letcha azz.
  132. if %skiy% equ 4 set wipe=2
  133. if %skiy% equ 4 goto sky1
  134.  
  135. ::: Wipe everything, internally and externally.
  136. if %skiy% equ 3 set wipe=3
  137. if %skiy% equ 3 goto sky1
  138.  
  139. if not exist %getw% echo .
  140. if not exist %getw% echo %sl%
  141. if not exist %getw% echo           *** Get-Wipe Program NOT Found. ***
  142. if not exist %getw% echo %sl%
  143. if not exist %getw% echo .
  144. if exist %getw% call %getw%
  145.  
  146. :sky1
  147. title %ttl1%%ttl2%
  148. ::
  149. if %wipe% equ 4 if %exit2% equ 4 goto return
  150. :: ^ Cancel was chosen.
  151. ::
  152. if %w% equ 4 goto externals
  153. :: ^^^ cps isn't available.
  154.  
  155. if %wipe% GTR 0 if %wipe% neq 2 del /f /s /q %cps%"\"*.*
  156. xcopy %src%"\"*.* %cps% /D /E /V /C /F /G /R /K /Y /Z /B /J
  157. echo .
  158. echo %time%
  159. if %errorlevel% neq 0 set /a exit2=3
  160. if %errorlevel% neq 0 goto externals
  161.  
  162. set txt=Backed up
  163. if %r3v3rs3% equ 2 set txt=Restored
  164. echo %l1%
  165. echo       ** %oper% Successfully %txt% Onboard!  **
  166.  
  167.  
  168. :externals
  169. if exist %ext2% call %ext2%
  170.  
  171.  
  172. :return
  173.  
  174.  
  175.  
  176. :: 100% -JpE-
  177.  
  178.  
  179.  
  180.  
Add Comment
Please, Sign In to add comment