Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

My application generates text files that need to be synced with remote servers, which may be windows or linux. Sync has to happen without user's intervention.

I tried with rsync but windows doesn't come with rsync by default. Also it is not possible to supply password in the command line for rsync.

Currently I'm going with ftp. But that seems like an inefficient way.

Is there a way to rsync without user intervention? What are the ways to sync with a remote server programmatically? App is on nodejs.

share|improve this question
3  
Can you not run rsync from cygwin? You should not need a password if you install a public ssh key on the remote computer. –  Giorgio Jun 7 '14 at 15:05
1  
I've used smbclient with bash scripts once to upload files on a remote windows server. Didn't like it, but it worked. –  scriptin Nov 4 '14 at 13:22
    
I just notice that this is project of the month at SourceForge. Maybe it can help? "software that helps you synchronize files and synchronize folders for Windows, Linux and Mac OS X" ... sourceforge.net/projects/freefilesync it looks liek I will be using it. Can you? –  Mawg Dec 4 '14 at 20:53

2 Answers 2

Synching entire files has the tendency to create more traffic than you want. It may be a better option to do this on a finer-grained level, using your own RPC service.

For example, you could have a look at Apache Thrift. It basically allows you to create a remote service to do next to anything what you want. It works cross-language, cross-platform out of the box, designed to be efficient and based on a very simple IDL.

While creating your own service may involve some work, you are no longer bound to transferring entire files (but you can of course do that as well), you will also be able to extend the service in the future easily.


If you still want to exchange whole files, consider compressing them beforehand, and using services like dropbox, or the like. Depending on the "disclosure-level" of your data, you may additionally want to encrypt them during transfer.

share|improve this answer

I think you should accomplish two tasks:

  1. watch source filesystem for change. This could be done by either cron job (task scheduler for windows) to check for changes, FTP watcher that checks changes in FTP server. I am sure there are other options too.
  2. You have to copy source files to target servers. This you can achieve in many ways trough ftp or ssh or even upload files through http.

Your best setup depends on what is already installed there on servers or what is easier for you to set up. Also do you need to sync back if files have changes in remote servers.

share|improve this answer
    
Both Windows & Linux allow an app to monitor a file, directory or device & be notified of change. But that, and your point 1, are not necessary here, since he is generating the files & knows when they change. I am assuming push to server, not server polling client for changed files. –  Mawg Dec 4 '14 at 12:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.