Hacker News new | past | comments | ask | show | jobs | submit login

I used Unison to sync between two laptops. In using only one laptop now and I switched to Syncthing to sync some folders of my phone, tablets and laptop. Unfortunately Unison doesn't run on Android. I liked the way it could perform a merge of the folders from different computers.



Can you not mount the android file system on your laptop, and sync the two different directory trees, running exclusively from the laptop?


Modern Androids only support mtp for data access, which doesn't work well for that use case.


I haven't tried unison yet, but you can mount android on your laptop wirelessly over ssh.

Enable your android phone's hotspot, and connect your laptop to that hotspot.

Install termux on android (playstore). Install openssh in termux. Setup passwordless pub/private keys to log in from laptop to android termux sshd.

  cat ~/.ssh/config # Laptop.

  Host someName # Your android.
    User u0_a168 # Whatever username termux gave you.
    HostName 192.168.43.1 # 'ifconfig' in termux for this.
    IdentityFile /home/you/.ssh/someName_id_rsa
    Port     8022 # Default termux sshd port.
Now this should work from your laptop:

  ssh someName
Log out of your laptop's termux session.

Install sshfs on your laptop, through your package manager or the manly way from github. I'm not manly.

Here's part of a script I use to get photos from my phone to my laptop.

  # Mount the phone's DCIM directory locally over ssh.
  # I had trouble with termux symlinks, so I went directly to /storage/...
  sshfs someName:/storage/emulated/0/DCIM ~/mnt/someName

  cd ~/mnt/someName/Camera

  cp -vn * ~/Pictures/. # Copy all pictures that aren't yet on laptop.

  mv * ../Saved/. # So ops on dcim/Camera don't take longer with more pics.

  cd ~/Pictures # Can't unmount until leave mount.

  fusermount -u ~/mnt/someName # Dismount. Gymnastic salute.

  # Do whatever postprocessing you like on your photos ...
https://wiki.termux.com/wiki/Main_Page

https://wiki.termux.com/wiki/Remote_Access

https://wiki.termux.com/wiki/Internal_and_external_storage

https://en.wikipedia.org/wiki/SSHFS

man sshfs

stackoverflow




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: