True Shared Directories Across Android and Linux

I like to keep a shared directory across my phone, tablet, laptop and workstation. I find this quite handy for my password db, getting documents/photos I save on mobile over to my desktop or to sync media out to my phone/tablet for offline use. Seems like a relatively simple goal but it’s been a bit complicated to find something reliable.

The obvious starting point would be Dropbox, Box, or even OwnCloud, but these all seem to have the same approach where the mobile apps just let you download the files you want on demand, by default nothing is synced to your mobile device automatically, and any file you add on Android must be saved and then manually uploaded. (in addition to being closed source, proprietary, and in someone elses control (with some exceptions for self-hosted OwnCloud))

I made a brief attempt at sshfs on the Linux systems, with /etc/fstab entries like these on Fedora (23 at the time of writing):

myuser@192.168.1.2:/home/myuser/Sync/all  /home/myuser/Sync/all  fuse.sshfs x-systemd.automount,_netdev,user,idmap=user,reconnect,transform_symlinks,identityfile=/home/myuser/.ssh/id_rsa,allow_other,default_permissions,uid=1001,gid=1001 0

I think there’s a lingering selinux problem there reading the ssh keys, but probably not too hard to solve, and as far as the linux systems on my home network go it seemed to work pretty well. However that left me with the problem of the Android devices for which I hoped FolderSync would cover me, but a two-way sync there is not aware of file deletions or moves, so you end up with files getting recreated and/or duplicated each time it runs.

Bittorrent Sync however sounds much closer, no centralized server, the devices just sync up over the bittorrent protocol and your data is never sent to any third party. It’s a bit clunky to get installed and linked, and not great on Fedora either as it’s closed source and thus not something you can just dnf install or run with systemd without some customization.

I thought to search for an open source alternative and landed at Syncthing, which is basically exactly what I’m looking for. On my home network everything is automatically synced when the devices are available. A deleted file propegates out to all the nodes correctly. Drop a file into the dir on any device and it’ll soon show up on all the others. It’s a pretty ambitious project and they’ve got clients out for Linux, Android, and a bunch of other operating systems already.

It is also not available in Fedora proper but you can install it from Copr relatively easily here. Link includes instructions for very easily starting it up with systemd for an arbitrary user on the system.

It too is a little clunky to setup and it probably should be said, can be a little buggy right now. If you’re sharing a directory from an existing node to your mobile device, you need to make sure you’ve got the webUI open on Android when the share is done so you can see the incoming prompt and actually add the directory, if you don’t you’ll miss the notification and I’ve read there’s no way to try again other than actually deleting the share on all nodes and re-creating it. I’ve also had one of my shares error out on Android and stay broken, doesn’t seem to be able to fix itself and I couldn’t find any way to get details. (Should have filed a github issue on that one, I will be doing that if it resurfaces)

Overall though, pretty great when working properly, which it does most of the time.

comments powered by Disqus