Web Hosting Talk







View Full Version : Crontab auto-updater


RaelOM
11-02-2006, 09:53 AM
So I'm running a shared platform with about 80 apps on it.

Out of that 80 or so apps a few have crontab access which is managed through group membership.

I need to design a system that will once an hour through a root cronjob, scan the project space of those that have crontab access (Belong to bppcron group) and within that project space I'm looking for /proj/<project name>/www/.crontab-admin/crontab-DEV (Or crontab-QA Or crontab-PROD). From there i run a diff -q | wc -l against an if logic checking for 1 or 0. If it's different run crontab -u <user> crontab-DEV (Or Crontab-QA, crontab-PROD)

This root cronjob will be run locally on each host. This logic makes sense for non-load balanced env's, but how would I be able to do this in a load balanced environment? I have two QA servers and four Production servers.

Any thoughts?

riscphree
11-03-2006, 10:19 PM
It might depend on your load balancing scheme. How do you have it set up?

pnorilsk
11-04-2006, 04:44 PM
There are few commercial scheduling programs to do this job easy.

arkin
11-06-2006, 02:24 AM
On linux there is a /etc/cron.hourly.

If you plan on coding something using php make sure you include #!/path/to/php at the very top of the file so that it can be run under CLI as an application.

Hope this helps.