From d20367d67b95bf95109377bca7b9e7ca330be8e1 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 7 Dec 2025 13:47:31 +0000 Subject: [PATCH] Update Readme.md --- Readme.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 1b3827f..247f7d2 100644 --- a/Readme.md +++ b/Readme.md @@ -14,4 +14,35 @@ This is a Gadgetbridge MQTT bridge for TrueNAS Scale, which allows you to connec ## Editing Sensors - add new mqtt sensor around here [main.py#L90](https://git.olli.info/Oliver/GadgetbridgeMqtt/src/branch/main/main.py#L90) -- add new function for new sensor around here [main.py#L208](https://git.olli.info/Oliver/GadgetbridgeMqtt/src/branch/main/main.py#L208) \ No newline at end of file +- add new function for new sensor around here [main.py#L208](https://git.olli.info/Oliver/GadgetbridgeMqtt/src/branch/main/main.py#L208) + +## Automated Gadgetbridge DB Shrink & Sync + +### 1. Install Apps (F-Droid) +* **Termux** (Terminal) +* **Termux:Boot** (Auto-start scripts) + +### 2. Configure Apps +* **Gadgetbridge:** Settings → Auto Export → Location: `/sdcard/Documents/GB_Raw` +* **Nextcloud:** Auto Upload → Custom Folder → Local: `/sdcard/Documents/GB_Sync` → Remote: `/Backup/Gadgetbridge` +* **Termux:Boot:** Open app once to initialize. + +### 3. Termux Setup (Run these commands) +```bash +# 1. Setup storage & install python +termux-setup-storage +pkg update -y && pkg install -y python wget + +# 2. Create script directories +mkdir -p ~/scripts ~/.termux/boot + +# 3. Download python script +wget -O ~/scripts/shrinkdb.py https://git.olli.info/Oliver/GadgetbridgeMqtt/raw/branch/main/termux_setup/shrinkdb.py + +# 4. Create autostart launcher +printf '#!/data/data/com.termux/files/usr/bin/sh\ntermux-wake-lock\npython ~/scripts/shrinkdb.py &\n' > ~/.termux/boot/start_gb +``` + +### 4. Finish +**Reboot your phone.** +The script will now run automatically, shrinking DBs from `GB_Raw` and placing clean versions in `GB_Sync` for Nextcloud. \ No newline at end of file