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 *

Calendar

April 2018
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Mar   May »

Archives

  • 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

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