A Termux bash script for backing up your Android device with restic.
- Automatically registers a periodic job (30 minutes interval) that only runs when the conditions are right (charging, battery not low, unmetered network)
- Aborts an ongoing backup when disconnecting from charger or Wifi (conditions are checked every 15 seconds)
- Posts notifications for errors and while backup is ongoing
- Install Termux and Termux:API
- Copy
restic-android.shinto Termux home and make it executable - Create custom
~/.config/restic-android/envfile based onenv.sample - Run
restic-android.shonce to set up scheduled job - Optional: Run termux-setup-storage to grant access to all shared storage
- Thanks to Clemens for the idea and helpful starting points in his post on doing the same with borgbackup.