Friday, October 5, 2012

Roll Your Own File/Folder Sync Solution the Easy Way

Well, easy is a relative term but I find RSync on Windows to be painful at best and Unison is better but no UI for those who aren't terminal-crazy. I'm somewhere in the middle.

So anyway, here are the links you need (and to give credit where it's due):

  To actually be able to sync files/folders in various way and have a UI to configure the rules.
  To fire off sync operations when files or folders are changed.
  To hide any command windows that might popup.

I'm in a hurry so I won't give you a step-by-step, but basically use the 1st link to install and configure SyncToy then go Google the syntax to execute a command-line sync of a "folder pair".

Once you have that syntax, use the 2nd link to create a .cmd (or .bat) file and .vbs file that will call the .cmd so that you can sync without a window popping up to annoy you.

Finally, use the 3rd link to download and configure TFS (TheFolderSpy) to monitor the folder your're syncing (the "Left" folder in SyncToy terms) and then use wscript to execute the vbs script and pass the .cmd file path so the sync won't popup.

Now anytime you change anything in the source ("left") folder or sub-folders, the sync will occur. Pretty much the same concept as Google Drive Sync, Drop Box, etc... except it doesn't require your data to go over the Internet, it can be used even locally on multiple drives, etc...  Complete control!

Enjoy!

Followers