Coder Social home page Coder Social logo

borgbackup_on_android's People

Contributors

findus23 avatar icebal avatar ravenschade avatar stonewareslord avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

borgbackup_on_android's Issues

build.sh no longer working

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

  • make install install-lib install-dev 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

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/

  • cd ..
  • export BORG_RSH=borg_ssh_wrapper
  • BORG_RSH=borg_ssh_wrapper
  • cp borg_ssh_wrapper /data/data/com.termux/files/usr/bin/borg_ssh_wrapper
  • chmod +x /data/data/com.termux/files/usr/bin/borg_ssh_wrapper
  • borg init borg_test
    ./build.sh: line 81: borg: command not found
  • borg create borg_test::1 borg
    ./build.sh: line 82: borg: command not found
  • borg list borg_test
    ./build.sh: line 83: borg: command not found
  • borg info borg_test::1
    ./build.sh: line 84: borg: command not found
  • borg list borg_test::1
    ./build.sh: line 85: borg: command not found
    $

lock timeout

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).

build.sh cannot install Cython

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

Restore Strategy

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?

Update to borg 1.1

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
  • reapply diff (a bit modified; see below)
  • 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)

Make an official Termux package

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)?

build.sh fails with "Package 'gnupg2' has no installation candidate"

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:

  • Termux 0.65
  • stock non-rooted Android 9 (Pixel 2/walleye, aarch65, kernel 4.4.116-gf260015dd1ec)

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)

Patch file doesn't work

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.