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
- Vorabpauschale: Theoretische zu versteuernde Rendite seit 1987
- Untersuchung der Kosten der gesetzlichen Kranken- und Pflegeversicherung in Deutschland 1962 – 2026
- Spanish Juggling problem
- Changing the maximum upload file size with Nextcloud in a docker-compose setup
- Shrinking a QNAP Virtualization Station disk image
Recent Comments
- Vorabpauschale: Theoretische zu versteuernde Rendite seit 1987 - Xeve on Untersuchung der Kosten der gesetzlichen Kranken- und Pflegeversicherung in Deutschland 1962 – 2026
- Andreas on Shrinking a QNAP Virtualization Station disk image
- Arjun on Fix for Latex4CorelDraw with CorelDraw 2017
- 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
Leave a Reply