USB Drive – How to Auto-Sync with Plugged-In Mass Storage Device

synchronizationusb-drive

I have (at the moment) three mobile USB mass storage devices (flash drive, phone, e-reader). I'd like to always have the latest versions of all my files with me (such as CV, passport, research papers, source code, etc.)

My files change often, so manually copying them every day is not feasible. Ideally, I'd like to plug in my flash drive (for example), have my PC automatically recognize it, mount it, sync it and unmount it.

And the following features 'would be nice':

  • GUI
  • Notification through Xorg/KDE/Gnome when syncing starts / stops.
  • And, why not: two way syncing. But that's not a priority.

I've found some questions that are related to this one:

But none of them answer my question completely. I suppose I could hack something together myself using udev, rsync, etc., given enough time. But I'd hate to reinvent the wheel. And time is something I don't have to spare right now. Ideally I'd like to use an existing solution, but I can't find one.

So, what would be the quickest way to set something like this up?

Best Answer

You can go the udev/rsync route but you will need to do some scripting. Check out inotify-tools in any case, these are very useful for sending filesystem change notifications to applications.

I know of three GUI (quick to set up) tools for synchronizing local filesystems.

  1. Unison is mature and well-documented. Monitoring methods are slightly outdated but it could be automated by inotify (still requires some scripting).

  2. DirSync Pro doesn't sound like free software, but it is.

  3. FreeFileSync is recently released but looks promising. It has an option to save directory comparisons as a batch and trigger synchronization on events, such as mounting an external drive.

Related Question