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.
Calendar
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
Leave a Reply