lipsync icon indicating copy to clipboard operation
lipsync copied to clipboard

Broken local dir declaration

Open conorsch opened this issue 13 years ago • 6 comments

Just setting up lipsync for the first time. I've run through the install.sh with elevated privileges and supplied all the arguments to generate to the /etc/lipsyncd conf file. Everything in there looks great.

Initial sync interprets the input for client directory as that fullpath, but on the server, rather than the client (local machine). I do not believe this is expected behavior. I've tested this several times. If I specify a fullpath that does indeed exist on the laptop ("client"), it will report that the directory does not exist, unless I create it on the server first, in which case it will work successfully. The client machine then syncs files correctly, but between the "client" and "remote" folders, both of which are on the remote machine ("server").

Am I misunderstanding something? Should there be both client and server folders on the server, and then I should set up my own rules for syncing? Should each client have its own folder on the server, in addition to the server master copy, or is this not expected behavior, as I suspected?

conorsch avatar Jul 02 '11 20:07 conorsch

Sorry, I should have mentioned this, as well: after the initial sync, successive syncs (observed in ~/.lipsync/lipsyncd.log) fail by trying to use rsync over port 22, even though a non-standard port is specified in /etc/lipsyncd, and worked correctly on the initial sync.

conorsch avatar Jul 02 '11 20:07 conorsch

If I am understanding correctly, the problem may lie in line 48 /bin/lipsync, which reads:

rsync -rav --stats --log-file=/home/$USER_NAME/.lipsyncd/lipsyncd.log -e "ssh -l $USER_NAME -p $SSH_PORT" --delete $REMOTE_HOST:$LOCAL_DIR $REMOTE_DIR

I believe $LOCAL_DIR and $REMOTE_DIR should be switched. Then, in /usr/local/bin/lipsync, line 48 has a different mistake:

rsync -rav --stats --log-file=/home/$USER_NAME/.lipsyncd/lipsyncd.log -e "ssh -l $USER_NAME -p $SSH_PORT" --delete $REMOTE_HOST:$$REMOTE_DIR $LOCAL_DIR

Note the double $ before "REMOTE_DIR." Just trying to provide useful feedback, hope I'm on target here.

conorsch avatar Jul 02 '11 21:07 conorsch

Ok, I've gotten this question before, so thanks for bringing it up:

If I am understanding correctly, the problem may lie in line 48 /bin/lipsync, which reads: rsync -rav --stats --log-file=/home/$USER_NAME/.lipsyncd/lipsyncd.log -e "ssh -l $USER_NAME -p $SSH_PORT" --delete $REMOTE_HOST:$LOCAL_DIR $REMOTE_DIR I believe $LOCAL_DIR and $REMOTE_DIR should be switched.

but if you check rsync docs (http://ss64.com/bash/rsync.html) it says:

rsync [option]... rsync://[user@]host[:PORT]/Source [Dest]

It sounds backwards, but I think it isn't - do you agree? This works for me doing sync from 2 clients to one server - so I think this works when doing client -> server, but the opposite is needed later when cron tries to pull the changes from the server.

philcryer avatar Jul 07 '11 01:07 philcryer

sync -rav --stats --log-file=/home/$USER_NAME/.lipsyncd/lipsyncd.log -e "ssh -l $USER_NAME -p $SSH_PORT" --delete $REMOTE_HOST:$$REMOTE_DIR $LOCAL_DIR Note the double $ before "REMOTE_DIR." Just trying to provide useful feedback, hope I'm on target here.

I'm not seeing this, /usr/local/bin/lipsync is moved in from bin/lipsync in the install, so it uses this file https://github.com/philcryer/lipsync/blob/master/bin/lipsync and I don't see the $$ on line 48:

rsync -rav --stats --log-file=/home/$USER_NAME/.lipsyncd/lipsyncd.log -e "ssh -l $USER_NAME -p $SSH_PORT" --delete $REMOTE_HOST:$LOCAL_DIR $REMOTE_DIR

maybe it was an issue when you were installing? Thanks for both of these points, I appreciate the feedback - have been trying to get more time to work on the project too.

philcryer avatar Jul 07 '11 02:07 philcryer

Sorry, I should have mentioned this, as well: after the initial sync, successive syncs (observed in ~/.lipsync/lipsyncd.log) fail by trying to use rsync over port 22, even though a non-standard port is specified in /etc/lipsyncd, and worked correctly on the initial sync.

Whoops, almost missed this one - let me retest with a new install in a bit... leaving issue open for now, thanks.

philcryer avatar Jul 07 '11 02:07 philcryer

Changing the initial sync order for me worked. I have not yet fixed the subsequent syncs failing due to port 22 being used despite declaration of nonstandard port during setup. I'm unclear on where init.d/lipsyncd is getting its variables from.

conorsch avatar Jul 09 '11 20:07 conorsch