Permalink
Browse files

at the end of the install, we now do an inital sync wit the server, that

means that the client and server will start with the same files - before
ran with the --delete feature of rync (something cron uses) to remove
anything from the server that wasn't on the client. We want it to do
that later, but not in the beginning.
  • Loading branch information...
1 parent 8c3be96 commit b1fa1c55dd230cebf36139ade967e0c432f4af1c @philcryer committed May 2, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 install.sh
View
@@ -170,6 +170,7 @@ deploy(){
mkdir /home/$username/.lipsyncd
chown $username:$username /home/$username/.lipsyncd
fi
+ echo "done"
echo -n " > /home/$username/.lipsyncd/lipsyncd.log..."
touch /home/$username/.lipsyncd/lipsyncd.log
@@ -187,6 +188,13 @@ deploy(){
echo "lipsync installed `date`" > /home/$username/.lipsyncd/lipsyncd.log
}
+initial_sync(){
+ echo -n "* Doing inital sync with server..."
+ . /etc/lipsyncd
+ su $USER_NAME -c 'rsync -rav --stats --log-file=/home/'$USER_NAME'/.lipsyncd/lipsyncd.log -e "ssh -l '$USER_NAME' -p '$SSH_PORT'" '$REMOTE_HOST':'$LOCAL_DIR' '$REMOTE_DIR''
+ echo "Initial sync `date` Completed" > /home/$username/.lipsyncd/lipsyncd.log
+}
+
start(){
/etc/init.d/lipsyncd start; sleep 2
if [ -f /home/$username/.lipsyncd/lipsyncd.pid ]; then
@@ -213,6 +221,7 @@ else
ssh.keygen
build.conf
deploy
+ initial_sync
fi
########################################

0 comments on commit b1fa1c5

Please sign in to comment.