diff --git a/README.md b/README.md index b551b21..cecde61 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,13 @@ add this line: ``` * * * * * /usr/local/bin/cluster_cron.pl cluster /mnt/shareddir 0 /var/spool/cron/crontabs >> /mnt/shareddir/cluster.log 2>&1 ``` + +## Modes +In mode 0 (active/passive) only one of the servers are active and the cron entries are commented out on the other servers. You can still edit the crontab on all servers, but cronjobs will only run on the active node + +In mode 1 (active/active) the cron file will be the same on all servers and all cronjobs will run everywhere. If you need som cronjobs to only run in one server and some cronjobs to run on all you can add two entries to the crontab of root on all severs but using different users (called "passive" and "active" in the example below) and differernt modes, e.g.: + +``` +* * * * * /usr/local/bin/cluster_cron.pl passive /mnt/shareddir 0 /var/spool/cron/crontabs >> /mnt/shareddir/cluster_passive.log 2>&1 +* * * * * /usr/local/bin/cluster_cron.pl active /mnt/shareddir 1 /var/spool/cron/crontabs >> /mnt/shareddir/cluster_active.log 2>&1 +```