File Sync

File Sync (and google calendar backup)

I’m really big into cross-platform apps and communication. I use a Vista desktop PC for home/play, a OSX Macbook Pro for work, and have a shared linux server for my website/backup. There are some files that I’d like to always keep synchronized between the 3 (namely my keepass passwords, my todo.txt, and a daily backup copy of my google calendar)

I still haven’t found an all-in-one solution for managing this, so here’s my hacked-together solution:

For those following along at home, you’ll need the following programs:

As for the actual process:

  • The linux server runs a cron script that periodically downloads the latest copy of my google calendar and places it in a specific directory. It also has a copy of the Unison binary
  • The windows box has a scheduled task that periodically ssh’s into the linux server and Unison syncs a specific directory with the server’s. Any changes to the directory on either end will be propagated to the other.
  • To keep things simple you could also run periodically run same script on the OSX box and be done with it. I prefer to use dropbox to keep the same ‘shared’ folder in sync between the Windows and OSX boxes. Rather than running periodically, dropbox will sync instantly whenever it detects a change in the ‘watched’ folder.
  • That’s it! Files from the linux server will periodically be sync’ed with the windows box. And the windows and mac boxes will always be in sync via dropbox. (Of course, if the Windows box were to go down, the OSX box wouldn’t have access to the linux files…)

Possible improvements:

  • Investigate the dropbox linux implementation. As far as I could tell, it was made to be a client gui, and wouldn’t run on a shared server that forbids long-running processes. (If you control your own box, this is probably the ideal solution, and you could forget using Unison all-together).
  • Write my own folder-watcher for ‘on-demand’ syncing. This would remove the need for dropbox (for those that don’t like trusting their data to 3rd parties…)
  • Find a solution that will also sync with mobile devices.