PDA

View Full Version : Dynamic cron



SJP
08-10-2004, 06:31 PM
So I was thinking it'd be nice if my web-site fired up when a certain number of e-mails were received instead of waiting until the prescribed time (cron) which could be hours away. I could do this using procmail (flags chr). I wouldn't want to count SPAM and I believe SPAMassassin inserts a special header indicating so. Does that happen before or after procmail? Anyhow in the case of 'carbon-copy' (the "c" flag) procmail forks a seperate copy so it is entirely conceivable that I could execute the process that is normally begun by cron if certain conditions were met. I suppose it's possible that if enough e-mail were received at a constant rate the web-site could be fired up often. Whether legitmate or not (somekind of virulent attack - stupid hacker) wouldn't make a difference because the amount of CPU alotted is fixed right? Are the AT services available, because scheduling the software to run when the system is least busy would be ideal.

SJP

jalal
08-11-2004, 12:59 AM
So I was thinking it'd be nice if my web-site fired up when a certain number of e-mails were received instead of waiting until the prescribed time (cron) which could be hours away

I don't understand this. Your webserver (Apache) 'fires up' whenever there is an HTTP request on the servers port 80, I don't know where cron comes into it.
The web site itself doesn't really 'fire up', it's always there, patiently waiting for HTTP, POP3, SMTP requests and similar.

SpamAssassin can be called as a pipe by procmail, which means it returns to procmail for further processing, so spamassassin is sort of in the middle of procmail, not before or after it.

SJP
08-11-2004, 11:49 AM
Sorry for the confusion. My web-site is 100% automated. Currently the cron launches my core program 6 times a day. It reads the mail box on its own.

SJP