views:

1263

answers:

5

For a current course I am taking, we are using a remote computer to run our code (It's a four node cluster, programming with MPI and C++).

I am coding locally on my MacBook and I'm looking for a good way to keep my local code up to date on the cluster.

The way I was doing it was to have a terminal open for running SCP to copy the directory, and another terminal that was SSH-ed into the cluster for making and running my code.

This seems less than optimal for me. Is there a way that I could automate the sending of the files to the cluster when they are modified? Or is there an IDE (XCode, if possible) that will allow me to this?

Or am I stuck with the one-line command to move everything? I am currently using TextMate to write the code. I have never picked up EMacs or Vim. Thanks.

EDIT: SVN is installed on the cluster, so I will be using that. It's good to know about rsync though! Thanks all

+5  A: 

Your best option, other than a distributed version control, is using rsync over ssh. I keep a couple of machines in sync by doing the following on each one:

rsync -urltv --delete -e ssh /src.dir othermachine:/src.dir

You mentioned using a MacBook - rsync is on Mac OS X. As far as I know, it didn't need to be installed extra. And the beauty of rsync is that it looks for modifications and only copies modified files over. It doesn't do merging of simultaneous modifications like a distributed version control system would, but if you're like me where you do some work on your laptop then some work on your desktop, rsync is the best way to send all the changed files (and only the changed files) from one to the other when you switch modes.

Paul Tomblin
Does rsync run on my comp only? I'm just wondering in case I don't have access to rsync on the cluster.
phsr
No, you need rsync at both ends of the ssh tunnel. This is very common however so I would definitely suck it and see.
Evan
I'll have to check this when I get home. One more question, does rsync look for modifications?
phsr
Yes, rsync does incremental backups.
Wadih M.
+5  A: 

If you can use rsync, that would probably be the best way.

Would using sshfs to (fuse) mount the remote folder(s) be an option? You could either edit the files directly, or use rsync, unison or any folder to folder synchronisation tool then.

Evan
+2  A: 

I know that's not the answer you know but you can setup an SVN or CVS server, which would be so much easier.

Otherwise I'd go for rsync.

dr. evil
A: 

Probably not what you're looking for, but you should have a look at a DSCM like git:

  1. create a repository in the remote server.
  2. clone it to your development machine using ssh.
  3. add / modify code
  4. use commit and push (again, over ssh) to merge the changes.
jcinacio
A: 

Even better than rsync is the Unison file synchronizer, which will allow you to make changes at either end and will detect and help resolve any conflicts. It works over ssh.

Norman Ramsey