Sync Your Files

Was thinking about making sense of “My Documents” folder for a long time already. This folder looks like the trash can on every device I have – basically a collection of stuff that is needed and relevant, that was relevant some time ago and stuff that should have been deleted around 10 years ago..

I have copies of old document folders archived from my previous work stations and laptops – everything is unstructured and of course I won’t find a needed doc without spending hours decompressing archives and searching and searching and searching..

Finally I gathered enough determination to stop this – put everything in order and make sure this structured way of storing my important files will transcend my current workstation, laptop, tablet, you got the idea. SO there will be the same folder with important stuff on every next system without manually copying and archiving everything and for that I need some software to sync my important stuff between the devices and OSes.

This is not a review therefore I am not going to compare all the alternatives I found, this is basically a message to my future self to refresh memory on the good stuff related to files sync.

Box – good sync clients for Windows and OSX, however to get proper files sync on Android I had to use different app – Auto Box Sync because as of now Android Box app does not offer automatic files sync – you have to select what you want to upload or download manually every time.

At the time of this post Box gives you 10GB free storage which is enough for my files, there are some limits like 250 megs per 1 file but you can lift the restrictions to 5GB per file and 100GB in total storage for 10$ a month.

UPDATE (10.09.2015)
On Linux you could easily use box without Box Sync app but with WebDav. You need to install davfs2 and configure it correctly, see this link for great description.

Why not Dropbox? It gives less space for free and it syncs all folders on all devices by default or so it seems, Box gives me a possibility to select which folders to sync and which not to. I do not sync all docs on my Android devices – only part due to the space restrictions but I still have the full sync benefits because I can put a file in a folder on my PC for sharing between Android devices and this file will appear on my phone and tablet.

That is not all though – if you have your own file server with stuff you do not want to be on the cloud or the total size is too large and cloud-storing this amount is too expensive then you need an app that would be able to run in the background and periodically sync over Samba/FTP/WebDAV/etc.

There is a free app for that with a very straightforward name – FreeFileSync however for that app to work you need some additional ground work like mapping your network location to some local file system path/drive.

I decided that I do not want to be doing that and would not like to have 2 points of potential failure instead of 1 (drive mapping failure or file sync app failure instead of just file sync app potential failure) so I used commercial alternative GoodSync which is ~30$ per workstation (Win or OSX) and used Synchronize Ultimate for Android. It has some in-app purchase options, most likely I used those but do not remember the actual cost, most likely it was something like couple of EUR.

Couple of words on security for the paranoid among us – yes it is possible your stuff will be snatched from the cloud but the chance your laptop would be stolen is much higher, the same goes for your phone. The simple conclusion is that you have to encrypt your home folder where your synced files are stored and you have to encrypt the device if we are talking about Android devices.

Use BitLocker for Windows, FileVault for OSX and EncFS for Linux.


Mount Samba Shares On Galaxy Note 10.1

I have a file  server with bunch of stuff stored there, this server is accessed by Windows and Linux machines. Because not only media is shared I did not chose DLNA but plain simple SMB shares.

Have to say if you just want to play movies from Samba share, use BSPlayer or MX Player – they both support streaming from SMB server without need to download movie to your device, much easier than setting up for proper SMB mounting.

Now I also have couple of Android devices and one of them is rooted Galaxy Note 10.1 16GB Wifi/3G (N8000). Have been thinking of making it able to mount Samba shares for quite a while already and finally decided that this is the day.. Would be nice to play movies & music streaming directly from server via Samba, right?

Well, 4 or 5 hours after I started this adventure my Galaxy Note was able to play content from the server over Wifi pretty decently. Hopefully with the info provided below next time it won’t take as much time from me or whoever is reading this.

What you need:

  • Rooted N8000 device with Android 4.1.2
  • These kernel modules (took correct versions for 4.1.2 from this thread)
  • Script that installs modules

Script have to be placed into /etc/init.d just don’t forget to chmod this file to make it executable. Also my device did not have /system/lib/modules folder so I had to create it and put modules there. Used SManager Android app for copying files to read-only partitions and making new directories on those partitions.

Finally when device reboots and modules are installed it is time for CifsManager app. That was my biggest issue and the thing I have lost 90% time on.. Mounted share was visible *only* to the root. All other apps either showed it empty or gave permissions errors.

I will skip the details, here are the options you have to specify for the share you are going to mount:

The most important was noperm - other apps finally displayed shared content after using it. Also enforced utf8 encoding helped to display proper Cyrillic instead of ?????? in some file names.
It is also important to correctly select directories that will serve as mount points, you have to have correct R/W permissions, at least this worked for me: /sdcard/cifs/[your share]

Android Support

Been thinking about supporting Android lately – if this is feasible and how easy it would be.. To be frank it would be troublesome porting sprot & spipc to Java and I am not even sure this is interesting enough to spend my free time on it.

However, as Android has Linux at its core running native code should be relatively easy, so my idea for now is to use this possibility – compile the whole solution with NDK, there is even Boost for Android so everything should be covered.

fplog, which is a client-side API will have to be wrapped JNI style to be usable out of Java apps. Also I am planning to include fplogd daemon as a resource for installable APK package and run the fplogd process from Java like it is described here.

The project is pretty far from running on Android but at least I see the way it could be done and I will try that after I see fplog working on Windows and normal desktop Linux.