Download Latest Version HAcron_bash+Perl.zip (19.1 kB)
Email in envelope

Get an email when there's a new version of Linux Administrator Bash Scripts

Home / HA Cronjobs Bash with Perl Script for Sync two server Cronjob
Name Modified Size InfoDownloads / Week
Parent folder
ReadMe.txt 2011-05-14 1.9 kB
HAcron_bash+Perl.zip 2011-05-14 19.1 kB
Totals: 2 Items   21.0 kB 0
##################################################################
# GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
# Script Name: HA CronJob
# Author: kelvin Tan (kelvintx3@gmail.com)
# Last Update: 13th May 2011
##################################################################
1. Introduction
2. Installation


Introduction:
This script main purpose is to allow two different server running 
the same set of Cronjob to ensure that if Primary Server is down
Secondary Server will take over the duty to perform daily task. This script
Uses Port connection to detect if server is up. If you like this script,
donate to support my research and development.

eg. file transfer, backup, ntp update, etc.

ha.sh (this is the main function file)
standby (this is the crontab file used when the primary server is alive)
crontab (This is the primary crontab files that primary server is currently using)
serverdb (This is the cluster node list, which contain all of the nodes that is suppose to take over the duty if primary server is down.
			End of introduction
			-----------------------

Installations

To install this HA script, your required to add the following line to the two crontab files that is going to be used.

* * * * /path to/ha.sh > /dev/null
This is to ensure that crontab continues to run even when the cronjob shifted.

[Serverdb]
This file contain the list of cluster that’s going to take over the cronjob.
For example:
Server A
Server B
Server C,

Server A is down, Server B will take over the cronjob, if Server A & B is down, C will take over. So for sure the cronjob will be run in some server. Server database structure would look something like this Server IP:port

192.168.0.1:80
192.168.0.2:80
192.168.0.3:22


WishList
---------
1. Auto Sync on cronjob configuration
2. More logging features.


Source: ReadMe.txt, updated 2011-05-14