Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
philcryer committed May 2, 2011
1 parent 8c3be96 commit b1fa1c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions install.sh
Expand Up @@ -170,6 +170,7 @@ deploy(){
mkdir /home/$username/.lipsyncd mkdir /home/$username/.lipsyncd
chown $username:$username /home/$username/.lipsyncd chown $username:$username /home/$username/.lipsyncd
fi fi
echo "done"


echo -n " > /home/$username/.lipsyncd/lipsyncd.log..." echo -n " > /home/$username/.lipsyncd/lipsyncd.log..."
touch /home/$username/.lipsyncd/lipsyncd.log touch /home/$username/.lipsyncd/lipsyncd.log
Expand All @@ -187,6 +188,13 @@ deploy(){
echo "lipsync installed `date`" > /home/$username/.lipsyncd/lipsyncd.log 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(){ start(){
/etc/init.d/lipsyncd start; sleep 2 /etc/init.d/lipsyncd start; sleep 2
if [ -f /home/$username/.lipsyncd/lipsyncd.pid ]; then if [ -f /home/$username/.lipsyncd/lipsyncd.pid ]; then
Expand All @@ -213,6 +221,7 @@ else
ssh.keygen ssh.keygen
build.conf build.conf
deploy deploy
initial_sync
fi fi


######################################## ########################################
Expand Down

0 comments on commit b1fa1c5

Please sign in to comment.