Skip to content
XeveAbout code and problems

Robust sync between Android phone and Linux computer

April 22, 2018 0 comments Article Uncategorized nspo

I already tried quite a few methods to reliably sync data (e.g. backups) between my Android phone and a Linux computer. Most were not good, some were horrible (MTP…). I just tried one that has proven to be the best, by far: installing an SSH server on the phone and then syncing with rsync. I used SimpleSSHD, which does not even need root permissions – and it still worked flawlessly. Sample rsync command:

cd Documents/Backups
rsync -avz --info=progress2 -e 'ssh -p 2222' 192.168.1.5:/storage/emulated/0/ 2018-04-22-phone/

Remarks:

  • The IP address needs to be replaced with the one that the SimpleSSHD interface shows
  • The password is autogenerated
  • The username does not matter
  • You can put an authorized_keys  file on the server and log in using your SSH key
  • Stopping and resuming the sync process works flawlessly
  • The transfer tends to get slow after a while when the screen is off, so either manually turn it on every 20 minutes or let it charge and keep the screen on for the whole process
  • Writing to the Android phone seems to not be as easy without root – I set the “login shell” to /sbin/su in the SimpleSSHD settings, and after that it worked fine. An alternative for non-rooted phones might be SSHelper.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Spanish Juggling problem
  • Changing the maximum upload file size with Nextcloud in a docker-compose setup
  • Shrinking a QNAP Virtualization Station disk image
  • Indexed Priority Queue in C++
  • Efficient Union-Find in C++ – or: Disjoint-set forests with Path Compression and Ranks

Recent Comments

  • 1win_qaSt on NMPC with CasADi and Python – Part 1: ODE and steady state
  • Andreas on Shrinking a QNAP Virtualization Station disk image
  • Arjun on Fix for Latex4CorelDraw with CorelDraw 2017
  • Nigel De Gillern on No wired (LAN) connection in Linux, although everything looks right
  • Harald H on Automatically reboot TP-Link router WDR4300 / N750 with bash script

Archives

  • January 2023
  • December 2022
  • January 2021
  • May 2020
  • April 2020
  • July 2018
  • May 2018
  • April 2018
  • March 2018
  • September 2015
  • August 2015
  • June 2015
  • March 2015
  • February 2015
  • September 2014
  • March 2013

Categories

  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright Xeve 2025 | Theme by ThemeinProgress | Proudly powered by WordPress