Musings of an Apple Systems Administrator
A blog about the day to day tasks of a systems administrator. A how to guide and user tell all about OSX Server systems issues and challenges.

Blogroll
Recent Comments
  • Will: Great, so glad Apple is supporting this, about time!
  • Daniel Laughland: Thanks for this! Made my life a lot easier. This beats the pants off of Squirrel Mail.
  • Philip Van Luchene: Great tip, you saved me a lot of hours. Thnx
  • Del Brown: Looks good Jon…good tips are hard to find:)
  • Jeremy Welnar: Hi Jon! Was googling around and found your post on the mail backups. I’m playing with rsync right now...
II Syncing a failover website : The Sync script
3

In this article we are picking up where we left off, we now have the ability to connect from our primary server to our secondary server without the need to enter a password with the help of a secret key. If you are lost at this point please refer to the last article Syncing a failover website : Creating an SSH key. At this point all we need to do is setup the bash script. We will create the script to log all of its activity so that we know if the process is having problems. The log file will be kept in a directory on the primary server. You will need to know the absolute path to this file and the file must be writable and readable by the system, so a chmod of 755 or 777 should do the trick.

#!/bin/bash
 
echo Sync started `date` >> /Volumes/Logs/Sync_log.txt
 
echo "Now starting rsync"

At this point we are ready for the sync to start, we will start by syncing the files from the primary server to the secondary server. This is a one way sync, whatever we add to the primary server will be copied over to the secondary server. Whatever is deleted from the primary server will also be deleted from the secondary server we accomplish this via the use of rsync. Read more..

| More