|
| 1 | +ORTHODOX PDF COLLECTION |
| 2 | +XED PRO / TERMINAL COMMANDS + WORKING rclone NOTES |
| 3 | +================================================== |
| 4 | + |
| 5 | +Purpose |
| 6 | +------- |
| 7 | +This file records the terminal workflow used in Xed Editor PRO to access the |
| 8 | +Google Drive folder "Orthodox PDF Collection" from Shared with me and pull the |
| 9 | +whole tree recursively. |
| 10 | + |
| 11 | +IMPORTANT SECURITY |
| 12 | +------------------ |
| 13 | +- Never put rclone.conf, OAuth tokens, Google client secrets, or private keys |
| 14 | + into GitHub. |
| 15 | +- Never paste an OAuth token into chat. |
| 16 | +- If an OAuth token was accidentally exposed, revoke/re-authorize it. |
| 17 | + |
| 18 | +1. BASIC XED / ANDROID TERMINAL SETUP |
| 19 | +------------------------------------- |
| 20 | + |
| 21 | +Create the destination folder: |
| 22 | + |
| 23 | + mkdir -p "/storage/emulated/0/Orthodox PDF Collection" |
| 24 | + |
| 25 | +Check the folder: |
| 26 | + |
| 27 | + ls -la "/storage/emulated/0/Orthodox PDF Collection" |
| 28 | + |
| 29 | + |
| 30 | +2. CHECK rclone |
| 31 | +--------------- |
| 32 | + |
| 33 | +Check that rclone is installed: |
| 34 | + |
| 35 | + rclone version |
| 36 | + |
| 37 | +Show configured remotes: |
| 38 | + |
| 39 | + rclone listremotes |
| 40 | + |
| 41 | + |
| 42 | +3. GOOGLE DRIVE REMOTE |
| 43 | +---------------------- |
| 44 | + |
| 45 | +The working remote used in Xed was: |
| 46 | + |
| 47 | + gdrive: |
| 48 | + |
| 49 | +The source folder was: |
| 50 | + |
| 51 | + gdrive:Orthodox PDF Collection |
| 52 | + |
| 53 | +Because the folder is under Google Drive "Shared with me", use: |
| 54 | + |
| 55 | + --drive-shared-with-me |
| 56 | + |
| 57 | +Test the top level: |
| 58 | + |
| 59 | + rclone lsf "gdrive:Orthodox PDF Collection" --drive-shared-with-me --max-depth 1 --files-only |
| 60 | + |
| 61 | +List everything recursively: |
| 62 | + |
| 63 | + rclone lsf "gdrive:Orthodox PDF Collection" --drive-shared-with-me -R --files-only |
| 64 | + |
| 65 | + |
| 66 | +4. LIST SHARED WITH ME |
| 67 | +---------------------- |
| 68 | + |
| 69 | +List Shared with me entries: |
| 70 | + |
| 71 | + rclone lsd "gdrive:" --drive-shared-with-me --max-depth 1 |
| 72 | + |
| 73 | +The explicit form used by the downloader experiments was: |
| 74 | + |
| 75 | + rclone lsd "gdrive,shared_with_me:" --max-depth 1 |
| 76 | + |
| 77 | +The explicit shared-with-me source form was: |
| 78 | + |
| 79 | + "gdrive,shared_with_me:Orthodox PDF Collection" |
| 80 | + |
| 81 | + |
| 82 | +5. THE WORKING XED DOWNLOAD COMMAND |
| 83 | +----------------------------------- |
| 84 | + |
| 85 | +This was the proven command that was visibly transferring the collection: |
| 86 | + |
| 87 | + rclone copy "gdrive:Orthodox PDF Collection" "/storage/emulated/0/Orthodox PDF Collection" --drive-shared-with-me -P --transfers 2 --checkers 8 --retries 10 --low-level-retries 20 --create-empty-src-dirs |
| 88 | + |
| 89 | +The command showed progress around: |
| 90 | + |
| 91 | + Transferred: 10.862 MiB / 12.309 GiB, 0%, 971.389 KiB/s |
| 92 | + Transferred: 6 / 1479, 0% |
| 93 | + Transferring: |
| 94 | + Philosophy/Blueprints of a Mind (Sorem).doc |
| 95 | + Philosophy/Christian A... Of Time (Bradshaw).pdf |
| 96 | + |
| 97 | +That confirmed that recursive downloading was working. |
| 98 | + |
| 99 | + |
| 100 | +6. RECOMMENDED STRONGER XED COMMAND |
| 101 | +----------------------------------- |
| 102 | + |
| 103 | +For a more persistent run: |
| 104 | + |
| 105 | + rclone copy "gdrive:Orthodox PDF Collection" "/storage/emulated/0/Orthodox PDF Collection" --drive-shared-with-me --create-empty-src-dirs --transfers 2 --checkers 8 --retries 20 --low-level-retries 50 --retries-sleep 10s --stats 15s --stats-one-line -P |
| 106 | + |
| 107 | +Why: |
| 108 | +- copy = never deletes local files |
| 109 | +- repeated runs resume by skipping files already present |
| 110 | +- transfers 2 is conservative for mobile |
| 111 | +- checkers 8 improves checking/listing |
| 112 | +- retries 20 handles transient Drive/network errors |
| 113 | +- low-level-retries 50 handles repeated HTTP/network failures |
| 114 | +- retries-sleep 10s spaces out retries |
| 115 | + |
| 116 | + |
| 117 | +7. RESUME AFTER INTERRUPTION |
| 118 | +---------------------------- |
| 119 | + |
| 120 | +If Xed closes, Android sleeps, Wi-Fi changes, or the connection fails, run: |
| 121 | + |
| 122 | + rclone copy "gdrive:Orthodox PDF Collection" "/storage/emulated/0/Orthodox PDF Collection" --drive-shared-with-me --create-empty-src-dirs --transfers 2 --checkers 8 --retries 20 --low-level-retries 50 --retries-sleep 10s --stats 15s --stats-one-line -P |
| 123 | + |
| 124 | +Run the same command again. rclone copy is resume-friendly and will normally |
| 125 | +skip files that are already successfully present. |
| 126 | + |
| 127 | + |
| 128 | +8. SOURCE SIZE / FILE COUNT |
| 129 | +--------------------------- |
| 130 | + |
| 131 | +Check total source size: |
| 132 | + |
| 133 | + rclone size "gdrive:Orthodox PDF Collection" --drive-shared-with-me |
| 134 | + |
| 135 | +Check downloaded local size: |
| 136 | + |
| 137 | + rclone size "/storage/emulated/0/Orthodox PDF Collection" |
| 138 | + |
| 139 | + |
| 140 | +9. SOURCE INVENTORY |
| 141 | +------------------- |
| 142 | + |
| 143 | +Save every source file path into a text file: |
| 144 | + |
| 145 | + rclone lsf "gdrive:Orthodox PDF Collection" --drive-shared-with-me -R --files-only > "/storage/emulated/0/orthodox-source-files.txt" |
| 146 | + |
| 147 | +Count source files: |
| 148 | + |
| 149 | + wc -l "/storage/emulated/0/orthodox-source-files.txt" |
| 150 | + |
| 151 | +Count source PDFs: |
| 152 | + |
| 153 | + grep -i '\.pdf$' "/storage/emulated/0/orthodox-source-files.txt" | wc -l |
| 154 | + |
| 155 | + |
| 156 | +10. LOCAL INVENTORY |
| 157 | +------------------- |
| 158 | + |
| 159 | +Save every downloaded local path: |
| 160 | + |
| 161 | + rclone lsf "/storage/emulated/0/Orthodox PDF Collection" -R --files-only > "/storage/emulated/0/orthodox-local-files.txt" |
| 162 | + |
| 163 | +Count local files: |
| 164 | + |
| 165 | + wc -l "/storage/emulated/0/orthodox-local-files.txt" |
| 166 | + |
| 167 | +Count local PDFs: |
| 168 | + |
| 169 | + grep -i '\.pdf$' "/storage/emulated/0/orthodox-local-files.txt" | wc -l |
| 170 | + |
| 171 | + |
| 172 | +11. VERIFY SOURCE VS LOCAL |
| 173 | +-------------------------- |
| 174 | + |
| 175 | +One-way verification: |
| 176 | + |
| 177 | + rclone check "gdrive:Orthodox PDF Collection" "/storage/emulated/0/Orthodox PDF Collection" --drive-shared-with-me --one-way --checkers 8 --combined "/storage/emulated/0/orthodox-check-combined.txt" |
| 178 | + |
| 179 | +If the check reports missing/mismatched files, run the copy command again and |
| 180 | +then run the check again. |
| 181 | + |
| 182 | + |
| 183 | +12. STRONG COPY + CHECK LOOP |
| 184 | +---------------------------- |
| 185 | + |
| 186 | +Download: |
| 187 | + |
| 188 | + rclone copy "gdrive:Orthodox PDF Collection" "/storage/emulated/0/Orthodox PDF Collection" --drive-shared-with-me --create-empty-src-dirs --transfers 2 --checkers 8 --retries 20 --low-level-retries 50 --retries-sleep 10s --stats 15s --stats-one-line -P |
| 189 | + |
| 190 | +Then verify: |
| 191 | + |
| 192 | + rclone check "gdrive:Orthodox PDF Collection" "/storage/emulated/0/Orthodox PDF Collection" --drive-shared-with-me --one-way --checkers 8 --combined "/storage/emulated/0/orthodox-check-combined.txt" |
| 193 | + |
| 194 | +If there are missing files, run the copy command again. |
| 195 | + |
| 196 | + |
| 197 | +13. LONG DOWNLOADS ON ANDROID |
| 198 | +------------------------------ |
| 199 | + |
| 200 | +Keep the Xed terminal/session alive while rclone runs. |
| 201 | + |
| 202 | +Android may stop background terminal processes because of battery |
| 203 | +optimization. For long downloads, allow the terminal app to run in the |
| 204 | +background and disable battery optimization for it in Android settings. |
| 205 | + |
| 206 | + |
| 207 | +14. USEFUL DEBUGGING COMMANDS |
| 208 | +----------------------------- |
| 209 | + |
| 210 | +Show the source path with verbose logging: |
| 211 | + |
| 212 | + rclone lsf "gdrive:Orthodox PDF Collection" --drive-shared-with-me --max-depth 1 --files-only -vv |
| 213 | + |
| 214 | +List recursively with verbose logging: |
| 215 | + |
| 216 | + rclone lsf "gdrive:Orthodox PDF Collection" --drive-shared-with-me -R --files-only -vv |
| 217 | + |
| 218 | +Inspect configured remotes: |
| 219 | + |
| 220 | + rclone listremotes |
| 221 | + |
| 222 | +WARNING: "rclone config show" can expose sensitive configuration. Do NOT |
| 223 | +copy its output into GitHub or chat. |
| 224 | + |
| 225 | + rclone config show |
| 226 | + |
| 227 | + |
| 228 | +15. IMPORTANT rclone BEHAVIOR |
| 229 | +----------------------------- |
| 230 | + |
| 231 | +Use: |
| 232 | + |
| 233 | + rclone copy |
| 234 | + |
| 235 | +Do NOT use: |
| 236 | + |
| 237 | + rclone sync |
| 238 | + |
| 239 | +for this backup/download workflow. |
| 240 | + |
| 241 | +copy: |
| 242 | +- downloads new/missing files |
| 243 | +- keeps existing local files |
| 244 | +- can be safely repeated |
| 245 | + |
| 246 | +sync: |
| 247 | +- makes destination match source |
| 248 | +- can delete destination files that are not in source |
| 249 | + |
| 250 | + |
| 251 | +16. WINDOWS VS CODE / POWERSHELL |
| 252 | +-------------------------------- |
| 253 | + |
| 254 | +When the gdrive remote is already authenticated, the Windows equivalent is: |
| 255 | + |
| 256 | + rclone listremotes |
| 257 | + |
| 258 | +Test the folder: |
| 259 | + |
| 260 | + rclone lsf "gdrive:Orthodox PDF Collection" --drive-shared-with-me --max-depth 1 --files-only |
| 261 | + |
| 262 | +Download to Desktop: |
| 263 | + |
| 264 | + rclone copy "gdrive:Orthodox PDF Collection" "$env:USERPROFILE\Desktop\Orthodox PDF Collection" --drive-shared-with-me --create-empty-src-dirs --transfers 2 --checkers 8 --retries 20 --low-level-retries 50 --retries-sleep 10s --stats 15s --stats-one-line -P |
| 265 | + |
| 266 | +Check the source size: |
| 267 | + |
| 268 | + rclone size "gdrive:Orthodox PDF Collection" --drive-shared-with-me |
| 269 | + |
| 270 | +Check the local size: |
| 271 | + |
| 272 | + rclone size "$env:USERPROFILE\Desktop\Orthodox PDF Collection" |
| 273 | + |
| 274 | +Verify: |
| 275 | + |
| 276 | + rclone check "gdrive:Orthodox PDF Collection" "$env:USERPROFILE\Desktop\Orthodox PDF Collection" --drive-shared-with-me --one-way --checkers 8 --combined "$env:USERPROFILE\Desktop\orthodox-check-combined.txt" |
| 277 | + |
| 278 | + |
| 279 | +17. WINDOWS SOURCE INVENTORY |
| 280 | +---------------------------- |
| 281 | + |
| 282 | +Save the recursive source inventory: |
| 283 | + |
| 284 | + rclone lsf "gdrive:Orthodox PDF Collection" --drive-shared-with-me -R --files-only | Set-Content "$env:USERPROFILE\Desktop\orthodox-source-files.txt" |
| 285 | + |
| 286 | +Count source lines: |
| 287 | + |
| 288 | + (Get-Content "$env:USERPROFILE\Desktop\orthodox-source-files.txt").Count |
| 289 | + |
| 290 | +Count source PDFs: |
| 291 | + |
| 292 | + (Get-Content "$env:USERPROFILE\Desktop\orthodox-source-files.txt" | Where-Object { $_ -match '(?i)\.pdf$' }).Count |
| 293 | + |
| 294 | + |
| 295 | +18. WINDOWS LOCAL INVENTORY |
| 296 | +--------------------------- |
| 297 | + |
| 298 | +Save the local inventory: |
| 299 | + |
| 300 | + rclone lsf "$env:USERPROFILE\Desktop\Orthodox PDF Collection" -R --files-only | Set-Content "$env:USERPROFILE\Desktop\orthodox-local-files.txt" |
| 301 | + |
| 302 | +Count local lines: |
| 303 | + |
| 304 | + (Get-Content "$env:USERPROFILE\Desktop\orthodox-local-files.txt").Count |
| 305 | + |
| 306 | +Count local PDFs: |
| 307 | + |
| 308 | + (Get-Content "$env:USERPROFILE\Desktop\orthodox-local-files.txt" | Where-Object { $_ -match '(?i)\.pdf$' }).Count |
| 309 | + |
| 310 | + |
| 311 | +19. WINDOWS RESUME COMMAND |
| 312 | +-------------------------- |
| 313 | + |
| 314 | +If the download stops, run the same command again: |
| 315 | + |
| 316 | + rclone copy "gdrive:Orthodox PDF Collection" "$env:USERPROFILE\Desktop\Orthodox PDF Collection" --drive-shared-with-me --create-empty-src-dirs --transfers 2 --checkers 8 --retries 20 --low-level-retries 50 --retries-sleep 10s --stats 15s --stats-one-line -P |
| 317 | + |
| 318 | + |
| 319 | +20. WINDOWS STATE / CONFIG |
| 320 | +-------------------------- |
| 321 | + |
| 322 | +The PowerShell downloader experiment stored state under: |
| 323 | + |
| 324 | + .orthodox-drive-downloader |
| 325 | + |
| 326 | +Typical contents: |
| 327 | +- rclone executable |
| 328 | +- rclone config |
| 329 | +- OAuth logs |
| 330 | +- source inventory |
| 331 | +- destination inventory |
| 332 | +- rclone check results |
| 333 | + |
| 334 | +Treat the directory as sensitive because the rclone configuration can contain |
| 335 | +OAuth credentials. |
| 336 | + |
| 337 | + |
| 338 | +21. WHAT HAPPENED WITH WINDOWS AUTO-AUTH |
| 339 | +---------------------------------------- |
| 340 | + |
| 341 | +The Windows experiment successfully: |
| 342 | +- downloaded rclone |
| 343 | +- started Google OAuth |
| 344 | +- detected the localhost authorization URL |
| 345 | +- opened the default browser |
| 346 | +- completed Google authorization |
| 347 | + |
| 348 | +The problem happened after authentication because rclone reported that its |
| 349 | +built-in/shared Google client ID was being retired during 2026. |
| 350 | + |
| 351 | +Therefore, when setting up a NEW Windows Google Drive remote in 2026, use |
| 352 | +your own Google OAuth Desktop client ID and client secret. |
| 353 | + |
| 354 | +Once the remote is configured, normal rclone copy commands are the simple part. |
| 355 | + |
| 356 | + |
| 357 | +22. ONE-LINE COPY COMMANDS |
| 358 | +-------------------------- |
| 359 | + |
| 360 | +Android/Xed: |
| 361 | + |
| 362 | + rclone copy "gdrive:Orthodox PDF Collection" "/storage/emulated/0/Orthodox PDF Collection" --drive-shared-with-me --create-empty-src-dirs --transfers 2 --checkers 8 --retries 20 --low-level-retries 50 --retries-sleep 10s -P |
| 363 | + |
| 364 | +Windows PowerShell: |
| 365 | + |
| 366 | + rclone copy "gdrive:Orthodox PDF Collection" "$env:USERPROFILE\Desktop\Orthodox PDF Collection" --drive-shared-with-me --create-empty-src-dirs --transfers 2 --checkers 8 --retries 20 --low-level-retries 50 --retries-sleep 10s -P |
| 367 | + |
| 368 | + |
| 369 | +23. MINIMAL COMMAND SET |
| 370 | +----------------------- |
| 371 | + |
| 372 | +If everything is already authenticated and you just want the collection: |
| 373 | + |
| 374 | +Windows: |
| 375 | + |
| 376 | + rclone listremotes |
| 377 | + |
| 378 | + rclone lsf "gdrive:Orthodox PDF Collection" --drive-shared-with-me --max-depth 1 --files-only |
| 379 | + |
| 380 | + rclone copy "gdrive:Orthodox PDF Collection" "$env:USERPROFILE\Desktop\Orthodox PDF Collection" --drive-shared-with-me --create-empty-src-dirs --transfers 2 --checkers 8 --retries 20 --low-level-retries 50 --retries-sleep 10s -P |
| 381 | + |
| 382 | + rclone check "gdrive:Orthodox PDF Collection" "$env:USERPROFILE\Desktop\Orthodox PDF Collection" --drive-shared-with-me --one-way --checkers 8 --combined "$env:USERPROFILE\Desktop\orthodox-check-combined.txt" |
| 383 | + |
| 384 | +Android/Xed: |
| 385 | + |
| 386 | + rclone listremotes |
| 387 | + |
| 388 | + rclone lsf "gdrive:Orthodox PDF Collection" --drive-shared-with-me --max-depth 1 --files-only |
| 389 | + |
| 390 | + rclone copy "gdrive:Orthodox PDF Collection" "/storage/emulated/0/Orthodox PDF Collection" --drive-shared-with-me --create-empty-src-dirs --transfers 2 --checkers 8 --retries 20 --low-level-retries 50 --retries-sleep 10s -P |
| 391 | + |
| 392 | + rclone check "gdrive:Orthodox PDF Collection" "/storage/emulated/0/Orthodox PDF Collection" --drive-shared-with-me --one-way --checkers 8 --combined "/storage/emulated/0/orthodox-check-combined.txt" |
| 393 | + |
| 394 | + |
| 395 | +END |
| 396 | +=== |
| 397 | +This is a command/reference sheet, not a credential store. Never commit OAuth |
| 398 | +tokens, rclone.conf, client secrets, or private credentials. |
0 commit comments