Robust sync between Android phone and Linux computer
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.
Recent Posts
Recent Comments
- 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
- Gene on Running multiple Django projects on one Apache instance with mod_wsgi
- nspo on NMPC with CasADi and Python – Part 1: ODE and steady state
Leave a Reply