Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken local dir declaration #34

Open
conorsch opened this issue Jul 2, 2011 · 6 comments
Open

Broken local dir declaration #34

conorsch opened this issue Jul 2, 2011 · 6 comments

Comments

@conorsch
Copy link

conorsch commented Jul 2, 2011

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
Copy link
Author

conorsch commented Jul 2, 2011

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
Copy link
Author

conorsch commented Jul 2, 2011

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.

@philcryer
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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.

@conorsch
Copy link
Author

conorsch commented Jul 9, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants