This question has two parts and so I will award it either together or half and half. I am trying to do mirroring between two servers so that i can start load balancing Apache. I am running Pound on another machine to do the balancing. None of that really matters other than background.
I am planning to run a bash script that loops continually, and runs an rsync command to push the files. It actually works great except that:
1) When the loop fires around again (I have a 30 second wait) rsync hits like 50-90% CPU use. I think this is while it is compiling the list to send. Is this normal for rsync?????
2) How do I get this to run in the background? I can get it to go away, and get back to the command shell (I forget what I did). But when I exit the ssh session, it stops running. I don't want it to be cron because it just loops.. so I just want to start it once and go.
Here is the script
# endless loop
while [ : ]
/usr/bin/rsync -Cavz -e ssh --exclude-from=$EXCLUDES $BASE_DIR $SLAVE:$BASE_DIR