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
  • 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...
  • Rusty Duncan: Hmm, I can think of an issue with mounting the drives in target disk mode. The new drives have the same...
III Syncing a failover website : Scheduling the sync
1

So now we have our backup script, we have our secure SSH tunnel between the two servers and we have successfully synced our two databases and our files. Now we just have to schedule this task so that we do not have to manually run this each time we need to synchronize our systems. On Mac OSX Servers you have two options you can use Crontab and run a Cronjob, or you can use Launchd. If your running a Linux server then your pretty limited to just a Cronjob. We will talk about both types of scheduling methods and which one makes the best sense for your setup.

Crontab is one of the longest lasting scheduling daemons around, its part of any linux / unix system and uses a file that will trigger a script at a specific time at specific intervals. Cron can be pretty amazing but pretty daunting too if you are unsure about how to use cron, I recommend starting out easy and using this GUI for Mac OSX called Cronnix.

Cronnix is a great tool because it lets you modify, save and create crontab cronjobs in a very easy to use interface. Before Cronnix you basically had to use the VI editor in order to edit the crontab file manually which did not always prove successful. Once your ready to make your first schedule then you need to know what time or at what intervals you want the backup to run. I had my backup script run at midnight every-night so my crontab looked like this.

1
0 0 * * * /bin/bash /path/to/my/sync/script.sh

Read more..

| More