From a98155983a4c9592a36aea558f955783deba6b51 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Fri, 22 Mar 2019 02:54:01 +0100 Subject: [PATCH] Update README, moving backup.sh into file instead. --- README.md | 44 +++++++++++++++++++------------------------- backup.sh | 5 +++++ 2 files changed, 24 insertions(+), 25 deletions(-) create mode 100644 backup.sh diff --git a/README.md b/README.md index aae894a..04fd656 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ If you have root permission on your device, you can use the "sudo" of Termux, [t conveniently gain root permissions in Termux and backup your complete device. -## Installation +## Building Borg Install [Termux](https://f-droid.org/en/packages/com.termux/) from F-Droid, open it, and execute the following: ```bash pkg install git @@ -22,43 +22,37 @@ git clone https://git.caspervk.net/caspervk/borgbackup_on_android cd borgbackup_on_android bash build.sh ``` -If virtualenv for Python does not work properly set selinux to permissive (`tsudo /system/bin/setenforce 0`). +If virtualenv for Python does not work properly, set selinux to permissive (`tsudo /system/bin/setenforce 0`). Warning messages like ``` WARNING: linker: /data/data/com.termux/files/usr/lib/libacl.so.1.1.0: unused DT entry: type 0xf arg 0x449 ``` -are due to the Android linker. More details can be found at https://stackoverflow.com/questions/33206409/unused-dt-entry-type-0x1d-arg. +are due to the Android linker. More details can be found [here](https://stackoverflow.com/questions/33206409/unused-dt-entry-type-0x1d-arg). Tested with: -- termux 0.56 -- borg 1.0.12, 1.1.3 +- Termux 0.56, 0.66 +- Borg 1.0.12, 1.1.3, 1.2.0a5 ## Configuration -So all in all my Android backup setup looks like: -- borg, termux and tasker -- termux: Task (https://f-droid.org/packages/com.termux.tasker/) for tasker integration -- tsu (using tsudo of the tsu package) -- .termux/tasker/backup.sh: -``` bash -#!/data/data/com.termux/files/usr/bin/bash -date -tsudo "~/borgbackup_on_android/borg.sh" -date -read -``` -- ~/borgbackup_on_android/borg.sh: +Install [Tasker](https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm) and +[Termux:Task](https://f-droid.org/packages/com.termux.tasker/) for Termux-Tasker integration. + +Copy backup script to a folder where Termux:Task can find it ```bash -#!/data/data/com.termux/files/usr/bin/bash -t=`date +%d_%m_%Y` -host=angler -dirs="/ /system /vendor /cache /persist /firmware /storage /data" -export BORG_RSH=borg_ssh_wrapper -source /data/data/com.termux/files/home/borgbackup_on_android/borg-env/bin/activate -borg create -C lz4 -p -v --stats --one-file-system backup:/backup/borg/$host::filesystem-$t $dirs +mkdir ~/.termux/tasker +cp backup .termux/tasker/backup.sh ``` +Create a repository passphrase (and remember to back it up!!) +```bash +head -c 1024 /dev/urandom | base64 > /data/data/com.termux/files/home/borgbackup_on_android/borg-passphrase +``` + +Change `` and `` in `borg.sh` to correct values. + + Dont forget to set ssh configs accordingly! diff --git a/backup.sh b/backup.sh new file mode 100644 index 0000000..d847551 --- /dev/null +++ b/backup.sh @@ -0,0 +1,5 @@ +#!/data/data/com.termux/files/usr/bin/bash +date +tsudo "~/borgbackup_on_android/borg.sh" +date +read