While Daniel Roggen has done a great job in porting unison and associated utilities to Android in a simple, free Android App, the actual synchronization step is left to either (a) the user, at the command line, or (b) using his for-pay sync App.

Not that I object to earning money by selling apps, but ‘just because’, here are steps that worked for me on my Android phone (which was ‘rooted’ simply by changing the settings in Settings-Security-Superuser).

### Enabling Android Debugging

On a local ‘real’ machine, plug in the device, and find the idVendor from watching tail -f /var/log/messages. Then create a new udev rules file in (for instance)/etc/udev/rules.d/51-android.rules :

Thereafter, adb commands will work :

### Dry run through

These instructions were also helpfully given in the Unison App (but having them here makes them much easier to implement).

Go into the right directory :

#### Check that unison runs

(one should also check out what version is running on the server, so that they can be matched)

#### Generate key pair

and then inspect the public key, so that it can be uploaded to the server’s .ssh/authorized_keys :

(remember to pop the orsa.key.pub into the right place on the server…)

#### Now test the sync command works

Here, you’ll need to choose suitable entries for :

• a (writeable) local directory for the sync’d folder

• the server’s sync’d folder

• the server’s domain (here ‘unison.example.com’)

• the user running unison on the server (here ‘unison’)

• the server’s port (here ‘23456’)

### Running the script on the phone

Having checked all that works, the final script (with comments) can be assembled on the local ‘real’ machine. Mine (stored in ~/.unison/android/ToRead.sh) looks like :

### Load the script onto the phone

Choose a suitable place for the script to live, and execute on the local ‘real’ machine :

Finally, the script can be run using a terminal program on the Android device :

All done!

Of course, the file ‘ToRead.sh’ can easily be adapted to other sync’d folders, so that you can have multiple sync’d folders being independently updated (or even put into a combined file).