Android UrBackup Client

UrBackup client for Android that backs up (and restores) e.g. /storage/sdcard0.

Compiling the backend should not be much of a problem, but the client needs a energy preserving mode where it only connects to the server if a backup needs to be done (notification via GCM ).
The frontend (GUI) needs to be written specifically for Android.

I think this is a great idea. I would also like to ask if anymore updates are coming to the android app to view backups. A way to restore files would be really convenient.

1 Like

Would be nice if it could also do a full backup of the storage. Would also pay for it. 7,99 € sounds reasonable.

1 Like

If you still developing the Android client, please do not add google’s gcm pre-load notification stuff, it doesn’t matter that there are no data – it requires the google framework.

I like open source and I like urbackup, please keep it clean.

Sorry to bump thread but did anyone try compiling this under Android as a cli app? Like compiling it under Termux?

All we need is an arm build I assume, so one could back up the sd card and the externals, not sure if we need any gui app, given that linux versions do not come with it by default anyway.

Maybe the binary client works… it’s compiled for ARM/ARM64 anyway…

To guarantee it works compile it with the Android NDK: https://developer.android.com/ndk/guides/other_build_systems

Android is going more in the direction of iOS currently, so apps cannot access files which are not explicitly selected via file picker. So idk how much sense an Android client would make at this point (unless the device is rooted):

https://developer.android.com/preview/privacy/scoped-storage

Thanks, do you know if there is any compiled arm binarty that does not require installation? I tried it under Termux, but it is trying to install into the system so tha tis not going to work for Termux.

Uncompressing install data...
Assuming RedHat (derivative) system
Detected architecture armv6-linux-engeabihf
install: /usr: Read-only file system
/data/data/com.termux/files/usr/tmp/tmp.tcMv7h[524]: /bin/rm: not found

thanks

Perhaps it works in a termux-chroot?

Ok, I got it installed under proot under termux.

I added some folders and the server can see the client but having an error when I run the command below

urbackupclientctl start

Assertion failed: Unsupported .eh_frame_hdr version (../../src/c++/libunwind/src/EHHeaderParser.hpp: decodeEHHdr: 62) Aborted

Edit:
Some progress. I can start the backup from the server, it pretends that it goes through a full back. However there are no files in the backup, only empty directories.

Here are some lines from the client log

2019-06-10 03:00:29: ERROR: Error getting internal id for group with id 9997
2019-06-10 03:00:29: ERROR: Error getting internal id for user with id 10210

And Some lines from the server’s client log

Error getting complete file (the log is flooded with tese messages)

JxgylLY7sYq5AV8P8ujU|sdcard/open_gapps_log.txt" from PHONE. Errorcode: CANNOT_OPEN_FILE (3)

It seems to me that it is looking at for those files in some weird location. The correct path for the file above should be /mnt/sdcard/

Bear in mind that I can browse and open all those files (/mnt/sdcard) in chroot no problem.

Here is how it is added

/mnt/sdcard sdcard symlinks_optional,one_filesystem,share_hashes

1 Like

Start client backend with debug logging (-v debug) and please look at the debug log output

Anything new here? Especially, saving the DCIM folder would be enough for a few of my family members (would exceed Google Photos free storage limit) :smiley:

1 Like

If you need a quick-fix solution in the meantime, I can suggest you this set up:

  • Create a synchronized folder with syncthing (Open source folder sync application on all platforms) between your phone and the server machine (or any machine that you want to store those and backup from there)
  • Make Urbackup backup that synchronized folder.

There’s lot of online tutorials for syncthing that would explain it better than me, so I don’t get too much into it. But still, here’s a few tips:

  • You can make a subclient that only backup that synced folder. This allow for a backup folder separate from the machine that sync it (like “my-machine[My-phone]”), which makes it seems like a separate client for your phone
  • If you use BTRFS or ZFS (With “Copy on write” enabled) for the backup storage, sync the folder directly on it. Urbackup and the disk will coordinate to not have duplicated data (The synced folder and the backup will be hardlinked)
  • Don’t hesitate to do multiple synced folders, it’s free!
3 Likes

Nice software, I will consider to use it, maybe :slight_smile:

Has there been any change with this?

Picking this up since it keeps being asked for. I’d like to work on an Android client and want to check the approach with you first.

Storage: since Android 11 an app can get “All files access”. Google Play allows it for backup apps, and F-Droid doesn’t restrict it. With that, the existing client backend can read the shared storage (DCIM, Documents, Download, …) with normal file paths, so scoped storage isn’t a blocker for the user’s files anymore. Other apps’ private data stays out of reach without root, which I think is fine.

Plan:

  • The client backend built with the NDK, running in a foreground service only while a backup runs.
  • Internet mode only (the phone connects to the server), started by Android’s own scheduler with conditions like Wi-Fi and charging. No Google push service needed, which also answers the concern above.
  • File backups only. Android has no snapshots.
  • A small app UI for the server address and key, the folders, status and “back up now”. Restores through the web interface at first.

Questions: would you want this in the main repository (and on which branch), or as a separate one? And is the existing internet client handling enough for a client that’s only online for short windows, or does the server need anything for that?

Sounds good!

To keep with the existing pattern perhaps the GUI as separate repo? The backend changes perhaps to 2.6.x.

It might be good – but we’ll see in testing. The startup delay setting needs to be forced to zero and/or removed for Android clients.

I know of someone doing Droidian image backups. Unfortunately not possible with Android. Just restoring the whole phone on loss 1:1 would be great.

Quick update: the Android client works. It runs the normal client backend in internet mode, with “All files access” for the shared folders. I tested backups, incrementals and a restore from the web interface on an Android 16 emulator and on a Galaxy S25+ with Android 17.

Backend PRs against 2.6.x: #177 (file open fix for non-root clients), #178 (server address list), #179 (Android build) and #180 (“android” client type, no startup delay).

The app is at GitHub - ljlongwing/urbackup_android: UrBackup client for Android (file backups in internet mode) · GitHub . It’s early, but if anyone wants to try it, I’m happy to get feedback.

1 Like