Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,61 @@ Unlike standard backups, this system uses `rsync --delete` to enforce a bidirect
* **segments_data.json**: The central database for tracking video series counters and optimized hashtag groups.
* **segment_manager2.py**: The logic engine for maintaining metadata consistency across all three phones.

## 📊 System Architecture Diagram

```mermaid
flowchart TB
subgraph "Device Fleet"
S23["📱 Samsung S23+"]
Pixel["📱 Google Pixel 9a"]
ZFlip["📱 ZFlip7"]
end

subgraph "GitHub Cloud"
Repo["🌐 termux-backup repo<br/>(Source of Truth)"]
end

subgraph "Core Scripts ~/.shortcuts/"
BA["backup-all<br/>🔄 Push device → Cloud"]
SI["sync-in<br/>⬇️ Pull Cloud → device"]
MGR["manager<br/>📊 Hashtag/content CRUD"]
CAM["org-camera-album<br/>📁 Media organizer"]
IIR["iir-log<br/>🔋 Battery logger"]
BU["backup-folder<br/>💾 Folder backup"]
end

subgraph "Hidden Engine .hidden/"
SEG["segment_manager.py<br/>🎬 Content tracker"]
DATA["segments_data.json<br/>#️⃣ Hashtag database"]
end

S23 <-->|"backup-all / sync-in"| Repo
Pixel <-->|"backup-all / sync-in"| Repo
ZFlip <-->|"backup-all / sync-in"| Repo

BA -->|"rsync --delete"| Repo
Repo -->|"git reset --hard"| SI
SI -->|"rsync --delete"| S23
SI -->|"rsync --delete"| Pixel
SI -->|"rsync --delete"| ZFlip

MGR --> SEG
SEG --> DATA
CAM -->|"mv + refresh"| S23
IIR -->|"every 20min"| battery_log["battery_status_log.txt"]
```

### Script Reference Table

| Script | Purpose | Direction |
|--------|---------|-----------|
| `backup-all` | Mirrors local → GitHub, deletes cloud files you deleted locally | ↑ Push |
| `sync-in` | Force-resets local to match GitHub exactly (destructive pull) | ↓ Pull |
| `manager` | Python CRUD for content segments & hashtag groups | 📊 Data |
| `org-camera-album` | Moves camera photos to named folders + refreshes gallery | 📁 Media |
| `iir-log` | Background battery logger (temp, voltage, health) every 20min | 🔋 Monitor |
| `backup-folder` | One-off folder backups | 💾 Archive |

## 🚀 Deployment

### Prerequisites
Expand Down