Hacker News new | ask | show | jobs
by MarkusWandel 2054 days ago
Syncing photos off. Termux has sshd (you have to start it manually once, then it stays running until Termux is killed or the phone is rebooted).

With ssh-copy-id it takes a single command (1-line script) to rsync the phone's DCIM directory to my main machine for further processing. Nothing needs to be done on the phone at all other than to lightly nudge it to wake it up so sshd sees the connection attempt.

Downside: Android security clampdowns mean termux can't see the SD card. So I can only sync down the phone's internal camera directory and that's where I have to store the new pictures and videos. This means space occasionally runs low and I have to move stuff to the SD card. But in the future, they probably won't allow Termux to even work any more in its current form - no "exec" of executables that werent' installed as part of the apk.

Why do all this? Because I'm old school. My phone is an extension of my data ecosystem, which lives on (redundant and backed-up) hard disks in my home computing setup. I don't even let the phone sync the photos to the cloud.

Admittedly I've found no other practical uses for it; all the interesting stuff is blocked by Android security (e.g. back up or otherwise process your call/SMS history).

4 comments

Alternatives:

Resilio Sync: use it in backup mode to sync photos to your desktop pc/mac/nas. Delete photos from phone when you want to free space. Also lets you access and edit normal files, either on demand or by sync. https://play.google.com/store/apps/details?id=com.resilio.sy...

PhotoSync: sync your photos to pretty much anything. https://www.photosync-app.com/home.html

The thing with these apps is, not your suggestion in particular, is its not ever as it was 20 years ago "use this app it does this", now it is, "use this app it will maybe ask to ship your data to NSA or China, ask for account registering signup, for sure it will make some network calls to who knows where and include adtracking and other nastiness, and will nag about some license or buy-up".

Termux, ssh and rsync. Thats it. It works. I tell my phone, try to rsync when its been charging for at least 5 minutes and its evening time. Hurray.

The other thing is that these apps invariably screw usability up in some way. I use Sweech as a Wifi file server on the phone, but to get pictures off... whoops, no multi select. so if I want to grab the newest 50 photos off the wife's phone, that's 50 checkmarks to click (I'm not geeky enough to have Termux on the wife's phone). Or apps that only talk to a companion app on your (Windows or Mac) computer using a proprietary protocol. Or simply need a crapload of taps to get the job done.

Whereas the rsync method is exactly this: "syncphone" on my main machine. If it doesn't connect, nudge the phone so it wakes up (it'll connect anyway eventually; the phone seems to wake up on its own now and then). And then it's all automatic and scriptable from that point. I realize that perhaps 0.1% of smartphone users have the skills to automate things at that level and therefore care.

The auto rsync when charging is a good idea. I guess Termux can still get access to the battery/charge state?

Another example of user hostility: While on Android phones, at least older ones, bulk transfer of files via USB to/from a Linux machine has always been hit and miss, it's been rock solid on iDevices. Just do "idevicepair" and after that, transfer away to your heart's content, fast and solid. Only now I read that the latest version of IOS may have messed that up too, in the name of security of course.

> Android security clampdowns mean termux can't see the SD card.

Not sure that's what's causing it; I can definitely scp files from my Android phone's SDCard to my servers. But I've not tried initiating the scp from the other machine to my phone.

For what it's worth, my SD card is unencrypted so Android treats it as external storage, rather than encrypted and integrated into Android's "system" storage.

Anyway what's left of filesystem access for Termux isn't really a blacklist as in "you're forbidden to go here" but rather feels like a whitelist. There are a few carefully selected places you're still allowed to go, front and center being the DCIM directory.

If DCIM syncing from external SD card is an issue, I would suggest looking into FolderSync. I've used it personally for music syncing. I'm old school too when it comes to curating my own music library.
Rooting isn't as terrifying as it used to be, and it means you can do actual real backups and genuinely own your data.
One issue is that these days many people work at places that have BYOD (Bring Your Own Device) policy. This means you install work related apps on your own phone rather than being supplied with a work phone like in the old days. Many of these apps refuse to work on a rooted phone "for security" (justified or not, that's the argument)
If dont know mich about these work related apps but all my banking apps work with a magisk based root. So maybe thats a workaround.
I'm pretty sure flashing a non-OEM ROM on my Note 9 would blow an eFuse that permanently marks the thing as having been modified.

Certainly, when I unlocked a Sony Xperia XA2 it did something similar where it won't ever get OEM updates ever again.