GlobalAccessSoftware

SyncOlderPhotos.bat

Nov 16th, 2023
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 8.13 KB | Software | 0 0
  1.  
  2.  
  3. @echo off
  4. title *** SyncOldPhotos.bat by -JpE- 20230212010002 ***
  5. :: TestsNOTwell Simplified to a folder or computer. Oh well.
  6. set ace="\\DADDIO-PC\Daddio_Older_Photos\125 NASA Pictures (Illuminati, Freemasons)\ace1.jpg"
  7. ::
  8. set bats=C:\Users\%username%\Documents\AAA Sync2Laptop\Batch Files\BCS-Suite
  9. ::
  10. if exist %fileo% goto start
  11. :: If ^ not AAA calling, set time var to now:
  12. set timethen=%time%
  13. set datethen=%date%
  14. set fileo="%bats%\caller_check.txt"
  15. set RunT="%bats%\runtime_display.bat"
  16. :: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  17.  
  18.  
  19. :start
  20. set /a sup=0
  21. set /A dad=0
  22. set /A bup=0
  23.  
  24. :restart
  25. set ver=v7.9.9.47 20230515015522 by -JpE-
  26. set /A aok=0
  27. echo .
  28. echo .
  29. ::
  30. set b1=****************************************************************
  31. set b2=**   ******************************************************   **
  32. set b3=***   ***   ***   ***   ***   ****   ***   ***   ***   ***   ***
  33. echo %b1%
  34. echo %b3%
  35. echo %b1%
  36. echo **   *                         *                          *   **
  37. echo **   ****       *    Custom Software by JpE    *       ****   **
  38. echo **      *                      *                       *      **
  39. echo %b2%
  40. echo **   **    Adapted 20210421021349 SyncOlderPhotos.bat    **   **
  41. echo %b2%
  42. REM echo %b2%
  43. REM echo **                                                            **
  44. echo **   Run from the JpE Side Only now. 20220420042022           **
  45. REM echo **                                                            **
  46. echo %b2%
  47. echo **   %ver%                        **
  48. echo %b1%
  49. echo %b3%
  50. echo %b2%
  51. echo **   Syncing older photos with Daddio and running backups.    **
  52. ::
  53. echo %b1%
  54. echo **   Today is %datethen% and It is now %timethen%            **
  55. echo %b1%
  56. if %bup% gtr 0 goto externals
  57. if %sup% gtr 0 goto externals
  58. if not exist %ace% goto skipit
  59.  
  60.  
  61. :: Daddio is Online
  62. echo **   Please wait. Bringing in Older_Photos from Daddio.       **
  63. echo %b1%
  64. ::
  65. set source0="\\DADDIO-PC\Daddio_Older_Photos"
  66. set destin0="D:\Older_Photos"
  67. :: *****************************************************************
  68. xcopy %source0% %destin0% /D /E /V /C /F /G /R /K /Y /B
  69. :: *****************************************************************
  70. echo %b1%
  71. echo **   Today is %date% and It is now %time%            **
  72. echo %b1%
  73. if %errorlevel% equ 0 set /A aok+=1
  74. if %errorlevel% neq 0 goto skipit
  75.  
  76. echo **   Daddio is Online! Now Syncronizing...                    **
  77. echo %b2%
  78. set task=Tasks
  79. if %aok% equ 1 set task=Task
  80. echo **   %aok% %task% Completed: %destin0% Brought in.         **
  81. echo %b1%
  82. echo **   Please wait while we Sync back to Daddio...              **
  83. echo %b1%
  84.  
  85. set destin1="\\DADDIO-PC\Daddio_Older_Photos"
  86. xcopy %destin0%"\"*.* %destin1% /D /E /V /C /F /G /R /K /Y /B
  87. echo %b1%
  88. echo **   Today is %date% and It is now %time%            **
  89. echo %b2%
  90. if %errorlevel% equ 0 set /A aok+=1
  91. if %errorlevel% neq 0 goto skipit
  92. ::: was if %aok% equ 2 ^^^^
  93.  
  94. set task=Tasks
  95. if %aok% equ 1 set task=Task
  96. echo **   %aok% %task% completed: Pics Synced to DADDIO.                **
  97. echo %b1%
  98. echo **   Now Syncing to Externals if available.                   **
  99.  
  100.  
  101. :skipit
  102. if %aok% neq 0 goto externals
  103. echo **   DADDIO is NOT Online Right Now.                          **
  104. set /A dad+=1
  105. goto retry
  106.  
  107.  
  108. :externals
  109. echo %b1%
  110. set source1="D:\Older_Photos"
  111. set destin2="X:\%username%-PC\Older_Photos"
  112. set destin3="I:\Older_Photos"
  113. set destin4="H:\Older_Photos"
  114. set destin5="R:\Older_Photos"
  115.  
  116. set /A which=0
  117. if exist %destin2% set /A which+=1
  118. if exist %destin3% set /A which+=2
  119. if exist %source1% set /a which+=4
  120. if exist %destin4% set /a which+=8
  121. if exist %destin5% set /a which+=16
  122.  
  123. if %which% lss 4 echo **   Older Photos Source drive is currently Offline.          **
  124. if %which% lss 4 set /a sup+=1
  125. if %which% lss 4 goto retry
  126.  
  127. if exist %destin2% goto backup
  128. if exist %destin3% goto backup
  129. if exist %destin4% goto backup
  130. if exist %destin5% goto backup
  131. :: NOTE: Doesn't return here in this language so this is okay.
  132.  
  133. echo **   No backup drives are currently Online.                   **
  134. set /A bup+=1
  135.  
  136.  
  137. :retry
  138. if %sup% gtr 7 goto ending
  139. if %bup% gtr 3 goto ending
  140. if %dad% gtr 3 goto externals
  141.  
  142. :: Can't default to Yes or it would hang below foreverafter.
  143. set msg="**   Bring it online and try again? (y\N): "
  144. choice /c yn /n /t 15 /d n /m %msg%
  145.  
  146. if %errorlevel% gtr 1 if %bup% gtr 0 goto ending
  147. if %errorlevel% gtr 1 if %sup% gtr 1 goto ending
  148. if %errorlevel% gtr 1 goto externals
  149.  
  150. echo **   Press any key when ready to try again.                   **
  151. echo %b1%
  152. echo **
  153. pause
  154. ::: Programmatic pause for user action.
  155. echo **
  156. echo %b1%
  157. goto restart
  158.  
  159.  
  160. ::::::::::::::::::::::::::::::::::::::::::::::::::::
  161. ::: reusable function saves on redundant code    :::
  162. ::: line 2 is just in case something slips past. :::
  163. ::::::::::::::::::::::::::::::::::::::::::::::::::::
  164. :copy2 <dir to copyto>
  165. set dir="%~1"
  166. if not exist %dir% echo **   %dir% is not online right now. & echo %b3%
  167. if exist %dir% if exist %source1% xcopy %source1%"\"*.* %dir% /D /E /V /C /F /G /R /K /Y /B
  168. exit /b %errorlevel%
  169. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  170.  
  171.  
  172. :backup
  173. echo **   Please wait while I check our backup archives.           **
  174. if %which% equ 0 goto ending
  175. if %which% leq 4 goto ending
  176. if %which% equ 6 goto backup1
  177. if not exist %destin2% goto backup1
  178. echo %b1%
  179. call :copy2 %destin2%
  180. echo %b1%
  181. if %errorlevel% equ 0 set /A aok+=1
  182. if %errorlevel% neq 0 goto backup1
  183. echo **   Success! %destin2% is NOW Up to Date.     **
  184. echo %b2%
  185. set task=Tasks
  186. if %aok% equ 1 set task=Task
  187. echo **   %aok% %task% Completed: %destin2% Brought.     **
  188. REM echo %b2%
  189.  
  190. :backup1
  191. REM echo pause 1
  192. REM pause
  193. if %which% equ 5 goto success
  194. if not exist %destin3% goto backup2
  195. echo %b1%
  196. call :copy2 %destin3%
  197. echo %b1%
  198. if %errorlevel% equ 0 set /A aok+=1
  199. if %errorlevel% neq 0 goto backup2
  200. echo **   Success! %destin3% is NOW Up to Date.            **
  201. echo %b2%
  202. set task=Tasks
  203. if %aok% equ 1 set task=Task
  204. echo **   %aok% %task% Completed: %destin3% Brought in.         **
  205. REM echo %b2%
  206.  
  207. REM set source1="D:\Older_Photos"
  208. REM set destin2="X:\%username%-PC\Older_Photos"
  209. REM set destin3="I:\Older_Photos"
  210. REM set destin4="H:\Older_Photos"
  211. REM set destin5="R:\Older_Photos"
  212.  
  213. :backup2
  214. REM echo pause 2
  215. REM pause
  216. if %which% lss 8 goto success
  217. if not exist %destin4% goto backup3
  218. echo %b1%
  219. call :copy2 %destin4%
  220. echo %b1%
  221. if %errorlevel% equ 0 set /a aok+=1
  222. if %errorlevel% neq 0 goto backup3
  223. echo **   Success! %destin4% is NOW Up to Date.            **
  224. echo %b2%
  225. set task=Tasks
  226. if %aok% equ 1 set task=Task
  227. echo **   %aok% %task% Completed: %destin4% Brought in.         **
  228. REM echo %b2%
  229. REM echo pause 3
  230. REM pause
  231.  
  232.  
  233. :: Latest addition
  234. :backup3
  235. REM echo pause 4
  236. REM pause
  237. if %which% lss 16 goto success
  238. echo %b1%
  239. call :copy2 %destin5%
  240. echo %b1%
  241. if %errorlevel% equ 0 set /a aok+=1
  242. if %errorlevel% neq 0 goto ending
  243. echo **   Success! %destin5% is NOW Up to Date.            **
  244. echo %b2%
  245. set task=Tasks
  246. if %aok% equ 1 set task=Task
  247. echo **   %aok% %task% Completed: %destin5% Brought in.         **
  248. REM echo pause 5
  249. REM pause
  250.  
  251.  
  252. :success
  253. echo %b1%
  254. set txt=Backup
  255. if %which% geq 7 set txt=Backups
  256. echo **   Process Finished: External %txt% Completed.            **
  257. REM echo pause 6
  258. REM pause
  259.  
  260.  
  261. :ending
  262. echo %b1%
  263. echo **   Today is %date% and It is now %time%            **
  264. echo %b1%
  265.  
  266. if exist %fileo% goto noexit
  267. :: if called by AAA-Sync.bat, do RunT at the end of it instead.
  268. set sl=         /*\/*\/*\/*\/*\/*\/*\/*\/*\/*\/*\/*\/*\/*\
  269. set l1=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  270. set l2=%b2% & set vers=     %ver%
  271. if not exist %RunT% echo %RunT% cannot be found!
  272. if exist %RunT% call %RunT%
  273. :: See modifications in runtime_display.bat
  274.  
  275.  
  276. :bbye
  277. REM echo pause 7
  278. REM pause
  279. echo %b1%
  280. set msg="**      S)tart over, P)ause or Q)uit? (Q): "
  281. choice /c spq /n /t 40 /d q /m %msg%
  282. echo %b1%
  283. if %errorlevel% equ 1 goto start
  284. if %errorlevel% neq 2 goto noexit
  285. :: This pause is programmed and not just for testing.
  286. echo **
  287. pause
  288. echo **
  289. goto bbye
  290.  
  291.  
  292. :noexit
  293.  
  294. :: Ttttttttthhhhhhhaaaaaatttttttssssss ALL Folks!
  295.  
  296. :: EOF 100% -JpE-
  297.  
  298.  
  299.  
Add Comment
Please, Sign In to add comment