Edit code locally and Run code remotely

Hi there, I’m wondering if I can use syncthing in the following use case:

  1. I have a server (have great computational resource), and a laptop
  2. I’d like to edit code on my laptop and run code on server

Can I use syncthing to sync remote serve and local laptop, and run the code through ssh command? Is syncthing “fast enough” for nearly real-time sync? Or is syncthing is basically for data storage only?

Thanks.

I think it can take up to 6 or so seconds for it to start syncing. If it’s a one way sync, you might want to use unison with an on save hook for your editor.

I found I can set the sync interval, right? To me, 10 seconds or so is acceptable. The thing is, if I set the sync (or scan) interval lower (say, 5 seconds or 10 seconds), will there be any CPU/network overhead/cost?

It’s indeed almost one way sync. However, I’m not really familiar with unison. Also, syncthing’s web GUI is really good in my opinion. I’ve tried to setup sync’ed folder on both my laptop and my server. Things work pretty well, thanks to the syncthing dev team!! So the only question is as I mentioned above, will the small sync interval cause any trouble? Given everytime the modified code should be only several bytes or KBs.

Thanks!!

I don’t think having a small rescan interval will be problem, subject the amount of data/files will be fairly small.

Also, you can set the rescan interval to 0 and use syncthing-inotify for faster and more accurate rescans, but there will still be up to 5 second delay.

Thanks for your kind reply! Just one more question, does the rescan interval need to be set on both machine? Or only need to be set on one machine, and it’ll auto configure another machine?

Thanks!

If it’s a one-way sync in your case, it only matters on the machine which is producing the changes. Each machine decides individually how often it wants to rescan the files.