Update README.md

master
Mikael Nordin 8 years ago committed by GitHub
parent 24bc37f72d
commit 14c8953ca5

@ -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
```

Loading…
Cancel
Save