ravenschade / borgbackup_on_android Goto Github PK
View Code? Open in Web Editor NEWproject to make borgbackup run on Android
License: BSD 3-Clause "New" or "Revised" License
project to make borgbackup run on Android
License: BSD 3-Clause "New" or "Revised" License
Libacl no longer builds, as it is missing configure.ac. this stops borgbackup from compiling. Relevant errors below.
checking whether the C compiler works... no configure: error: in /home/Git/borgbackup_on_android/borg/acl-2.2.52': configure: error: C compiler cannot create executables See
config.log' for more details + make
libtoolize -c libtoolize -n -i >/dev/null 2>/dev/null && echo -i
-f libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' cp include/install-sh . aclocal -I m4
aclocal: error: 'configure.ac' is required
make: *** [Makefile:68: include/builddefs] Error 1
libtoolize -n -i >/dev/null 2>/dev/null && echo -i
-f libtoolize: putting auxiliary files in '.'.borg/platform_linux.c:483:10: fatal error: 'sys/acl.h' file not found
#include "sys/acl.h"
^~~~~~~~~~~
1 error generated.
error: command 'aarch64-linux-android-clang' failed with exit status 1
----------------------------------------
Command "/home/Git/borgbackup_on_android/borg-env/bin/python3 -c "import setuptools, tokenize;file='/home/Git/borgbackup_on_android/borg/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" develop --no-deps" failed with error code 1 in /home/Git/borgbackup_on_android/borg/
Currently getting the below error now. I have blown the folder away and let it recreate with proper permissions and still is not working. doing this in termux-choot btw.
Failed to create/acquire the lock /home/.cache/borg/62cd6172a3a10061f1a7298357d23921a909333703d81fe4962f33102cd69036/lock.exclusive (timeout).
Using OnePlus 3 with sultanxda Lineage 14.1.
Running setup.py bdist_wheel for Cython ... error
Complete output from command /data/data/com.termux/files/home/borgbackup_on_android/borg-env/bin/python3 -u -c "import setuptools, tokenize;__file__='/data/data/com.termux/files/usr/tmp/pip-install-g58qt4vz/Cython/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /data/data/com.termux/files/usr/tmp/pip-wheel-9_ay5rg0 --python-tag cp36:
Unable to find pgen, not compiling formal grammar.
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.6
copying cython.py -> build/lib.linux-aarch64-3.6
creating build/lib.linux-aarch64-3.6/Cython
copying Cython/Shadow.py -> build/lib.linux-aarch64-3.6/Cython
copying Cython/Coverage.py -> build/lib.linux-aarch64-3.6/Cython
copying Cython/__init__.py -> build/lib.linux-aarch64-3.6/Cython
building 'Cython.Plex.Scanners' extension
creating build/temp.linux-aarch64-3.6
creating build/temp.linux-aarch64-3.6/data
creating build/temp.linux-aarch64-3.6/data/data
creating build/temp.linux-aarch64-3.6/data/data/com.termux
creating build/temp.linux-aarch64-3.6/data/data/com.termux/files
creating build/temp.linux-aarch64-3.6/data/data/com.termux/files/usr
creating build/temp.linux-aarch64-3.6/data/data/com.termux/files/usr/tmp
creating build/temp.linux-aarch64-3.6/data/data/com.termux/files/usr/tmp/pip-install-g58qt4vz
creating build/temp.linux-aarch64-3.6/data/data/com.termux/files/usr/tmp/pip-install-g58qt4vz/Cython
creating build/temp.linux-aarch64-3.6/data/data/com.termux/files/usr/tmp/pip-install-g58qt4vz/Cython/Cython
creating build/temp.linux-aarch64-3.6/data/data/com.termux/files/usr/tmp/pip-install-g58qt4vz/Cython/Cython/Plex
aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Oz -Oz -fPIC -I/data/data/com.termux/files/usr/include/python3.6m -c /data/data/com.termux/files/usr/tmp/pip-install-g58qt4vz/Cython/Cython/Plex/Scanners.c -o build/temp.linux-aarch64-3.6/data/data/com.termux/files/usr/tmp/pip-install-g58qt4vz/Cython/Cython/Plex/Scanners.o
In file included from /data/data/com.termux/files/usr/tmp/pip-install-g58qt4vz/Cython/Cython/Plex/Scanners.c:19:
/data/data/com.termux/files/usr/include/python3.6m/Python.h:39:10: fatal error: 'crypt.h' file not found
#include <crypt.h>
^~~~~~~~~
1 error generated.
error: command 'aarch64-linux-android-clang' failed with exit status 1
----------------------------------------
Failed building wheel for Cython
Running setup.py clean for Cython
Running setup.py bdist_wheel for coverage ... done
Stored in directory: /data/data/com.termux/files/home/.cache/pip/wheels/24/76/26/c60de6a591b00f71dcf87941eb41b8f29820857eade91fe66f
Running setup.py bdist_wheel for py-cpuinfo ... done
Stored in directory: /data/data/com.termux/files/home/.cache/pip/wheels/bd/e6/74/5f9ff2150a62868acf69169db535d99949f838ac2f8e0b5d4b
Successfully built coverage py-cpuinfo
Failed to build Cython
First of all: thanks for those scripts, installing borg was a piece of cake on my phone like that! I've run my first successful backup of my phone right now.
But I consider backups only as existing if I am able to restore them. Is there some experience how to restore borg backups to Android devices?
I think i would at least have to restore the ROM to the device, install termux and borg. Restoring sdcard content (infernal and external) should be straight forward, but how does one deal with /data and such? Afaik the package installer wipes the data-dir of an APP on Installation, so restoring APP data would only be possible after installing the respektive APP first?!
Any experience with that?
First of all many thanks for your work. Before I was using borg on a folder mounted via go-mtp but that didn't work that well and needed to copy all files via USB on every run. With borg running on the phone it's by far faster.
I just tried if borg 1.1 is also working, but I am running into an error. What I did:
git checkout 1.1.2
pip install -e .
But on every run borg is showing this error:
(borg-env) bash-4.4$ borg --version
WARNING: linker: /data/data/com.termux/files/usr/lib/libacl.so.1.1.0: unused DT entry: type 0xf arg 0x453
Traceback (most recent call last):
File "/data/data/com.termux/files/home/borgbackup_on_android/borg-env/bin/borg", line 11, in <module>
load_entry_point('borgbackup', 'console_scripts', 'borg')()
File "/data/data/com.termux/files/home/borgbackup_on_android/borg-env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/data/data/com.termux/files/home/borgbackup_on_android/borg-env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2749, in load_entry_point
return ep.load()
File "/data/data/com.termux/files/home/borgbackup_on_android/borg-env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2402, in load
return self.resolve()
File "/data/data/com.termux/files/home/borgbackup_on_android/borg-env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2408, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/data/data/com.termux/files/home/borgbackup_on_android/borg/src/borg/archiver.py", line 38, in <module>
from .archive import Archive, ArchiveChecker, ArchiveRecreater, Statistics, is_special
File "/data/data/com.termux/files/home/borgbackup_on_android/borg/src/borg/archive.py", line 24, in <module>
from .cache import ChunkListEntry
File "/data/data/com.termux/files/home/borgbackup_on_android/borg/src/borg/cache.py", line 30, in <module>
from .crypto.key import PlaintextKey
File "/data/data/com.termux/files/home/borgbackup_on_android/borg/src/borg/crypto/key.py", line 28, in <module>
from ..platform import SaveFile
File "/data/data/com.termux/files/home/borgbackup_on_android/borg/src/borg/platform/__init__.py", line 21, in <module>
from .linux import API_VERSION as OS_API_VERSION
ImportError: dlopen failed: cannot locate symbol "sync_file_range" referenced by "/data/data/com.termux/files/home/borgbackup_on_android/borg/src/borg/platform/linux.cpython-36m.so"...
Any ideas what could cause this?
System information:
Device | Oneplus 3T |
Android version | 7.1.2 (LineageOS) |
Termux version | 0.54 |
diff --git a/setup.py b/setup.py
index 42b27261..9a71aecc 100644
--- a/setup.py
+++ b/setup.py
@@ -161,7 +161,7 @@ def detect_libb2(prefixes):
crypto_libraries = ['crypto']
possible_openssl_prefixes = ['/usr', '/usr/local', '/usr/local/opt/openssl', '/usr/local/ssl', '/usr/local/openssl',
- '/usr/local/borg', '/opt/local', '/opt/pkg', ]
+ '/usr/local/borg', '/opt/local', '/opt/pkg', '/data/data/com.termux/files/usr/']
if os.environ.get('BORG_OPENSSL_PREFIX'):
possible_openssl_prefixes.insert(0, os.environ.get('BORG_OPENSSL_PREFIX'))
ssl_prefix = detect_openssl(possible_openssl_prefixes)
@@ -172,7 +172,7 @@ def detect_libb2(prefixes):
possible_lz4_prefixes = ['/usr', '/usr/local', '/usr/local/opt/lz4', '/usr/local/lz4',
- '/usr/local/borg', '/opt/local', '/opt/pkg', ]
+ '/usr/local/borg', '/opt/local', '/opt/pkg', '/data/data/com.termux/files/usr/' ]
if os.environ.get('BORG_LZ4_PREFIX'):
possible_lz4_prefixes.insert(0, os.environ.get('BORG_LZ4_PREFIX'))
lz4_prefix = detect_lz4(possible_lz4_prefixes)
It's great that you have borg working in Termux. Would it be possible to make it an official package, so that it is easier to install (without having to build from git)?
Awesome script, @ravenschade, thank you!
This is a bug report on the issue fixed by #8.
What happens: build.sh fails due to missing utilities.
Fixed by: #8
My environment:
Output:
$ cd borgbackup_on_android; bash build.sh
+ apt -y install make clang openssl-dev perl tsu wget git python python-dev gnupg2 dirmngr curl autoconf automake sed gettext gzip pkg-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gnupg2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
gnupg
E: Package 'gnupg2' has no installation candidate
(many additional failures, because the `apt -y install` command did not complete)
The patch file needs to be updated for the new version I think. Didn't work for me, had to manually patch linux.pxy with the changes you made.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.