Page 1 of 1

file sync over sftp

Posted: 04 May 2016, 00:09
by Victoria_La
I cannot find any information on how to properly sync files for source code.
Now days people don't run sftp manually with password but use ssh key auth.
Is there a way to upload my keys?
How other developers sync files?

Re: file sync over sftp

Posted: 04 May 2016, 11:34
by pikiou
I'm sure you're looking for a simple tool, but mine is NetBeans 8.
It's a free editor that supports all formats and uploads files over sftp whenever they are changed (internally or externally).
I extensively use copy/paste history, refactoring, auto-completion, git support, file history view...
Make sure you have the Oracle release of Java otherwise you'll face issues.

Useful shortcuts
alt left/right: jumps to previous/next places you were at
ctrl q: jump to previous places you modified
ctrl b: jump to declaration
ctrl g: go to line number
ctrl p: show function parameter declaration from a function call
ctrl shift space: show php library function full documentation
ctrl shift d: show last 9 copied text even if the text was copied from outside NetBeans. click or type 0..9 to paste
ctrl f: search for selection; F3 for next, shift F3 for previous; +shift = whole project
ctrl h: replace selection; +shift = whole project
ctrl /: comment one or more lines; +shift = opposite effect
tab: add a tabulation to all selected lines; +shift = opposite effect
ctrl shift v: paste and format so it's well indented
ctrl shift s: save all project files

Re: file sync over sftp

Posted: 04 May 2016, 22:43
by Victoria_La
I ended up using sshfs + lsyncd + rsync (I am on ubuntu)
That syncs my local directory in workspace to remote, when changes are made using file system notifications.
In use local workspace to edit files with my IDE (eclipse with php). And store these in local git repo.


Here is the script I use if anybody else interested (that restarts syncing daemon):

#!/bin/bash
BASEDIR=`dirname $0`
REMOTE=$BASEDIR/remote
LOCAL=$BASEDIR/workspace
GAME=mygamenamehere

fusermount -u $REMOTE
sshfs myusernamehere@1.studio.boardgamearena.com: $REMOTE

killall lsyncd
lsyncd -rsync $LOCAL/$GAME/ $REMOTE/$GAME

Re: file sync over sftp

Posted: 05 May 2016, 07:16
by Een
Also, on Ubuntu, you can just use Nautilus "connect to a server" function with URL sftp://1.studio.boardgamearena.com
Then you'll get a mounted local folder mapping your studio folder and you can use any editor you like without further need for sync (I think Geany is a nice editor, not yet bloated with too many features :) )