views:

170

answers:

7

We need to distribute documents to our partners on a USB key. I've been asked to develop a piece of software that will check if some documents have been updated on the server and proceed with the synchronization of files on the memory stick.

The software itself will also need to have an auto-update functionality in case we want to improve it in the future.

Where do you guys think I should start?

+1  A: 

I would suggest Python... you can make its executable or install it on usb itself(its not big). A big advantage you can improve it on the spot as you wont need recompilation. Python is great for such small tasks.

A big advantage is platform independence.

Umair Ahmed
+1  A: 

Well it depends on the environment you are deploying to obviously, and what you personally have worked with. Off the bat I would be leaning towards C#, as there is a lot of documentation and will allow you to rapidly deploy a windows app with gui. However if this is a Unix environment I sure this could be done in a simple shell script.

theraven
+1  A: 

Whatever language you're most comfortable in and most skilled at, as long as it has an easy way to communicate with the server. (If the server is a web server, that's probably not an issue)

SLaks
+1  A: 

I'm assuming this is for Windows. C# would be an excellent choice, unless you can't be sure the user already has .Net installed. Otherwise I'd use Delphi, which can create native executables easily. The auto-update feature will be a pain no matter what language you use, given that a running EXE file can't replace itself. You can implement most of the program's functionality as a separate DLL which can be updated on the fly, but you're still SOL if you need to update the core EXE itself.

MusiGenesis
A: 

Assuming this is Windows, I would start with this batch file on the USB device: xcopy /diyc . $ServerPath

Perhaps that is enough?

Explanation on the flags:

/D Copies only those files whose source time is newer than the destination time.
/I If destination does not exist and copying more than one file, assumes that destination must be a directory.
/C Continues copying even if errors occur.
/Y Suppresses prompting to confirm you want to overwrite an existing destination file.
Hallgrim
+1  A: 

I would look into Microsoft Sync Framework. Look at the section "Introduction to File Synchronization." "...use the Sync Framework to efficiently move files between desktops and devices."

I used "Sync Services for ADO.Net" (part of the Framework) for a project to sync a local SQL Express database with the main SQL Server database and it saved me a ton of time.

JBrooks
+1  A: 

Rsync exists for Windows in Cygwin - it also supports ssh with a public key infrastructure if your server supports ssh. This could be a very secure and easy way to synchronize data.

weismat