I usually write such things in Java. That's how I do it. :)
Just kidding.
Anyway, there are several ways:
1) Have the auction script do the cleanup every so often itself
The problem with this method is that it is non-deterministic and it can be
more resource intensive if the script is used a lot.
If the script is not used a lot, it really doesn't matter and it can be
nice not having to worry about a cron job -- however you script seems to
want to do a LOT not just a few things in maintenance so I wouldn't
recommend this method anyway.
2) Write a separate mod_perl handler yourself.
Why mod_perl? If it's an admin script you can just simply whip it up and
use it. However, I will say that I am always wary of admin web pages as it
exposes your system to the outside world and potential hackers.
This model is useful if your maintenance is so infrequent you don't need to
run the admin more than once a day or once a week on your own schedule.
3) CRON Job
Do this if you want the job timed to a low granularity. eg once a day.
4) Perl Daemon that sleeps and then wakes up to try maintenance tasks.
Do this if you want the job timed to a low granularity. eg once every 5
minutes. It sucks to have CRON load up your system with calls to load Perl
every 5 minutes after putting in so much effort to make things faster with
mod_perl.
At 05:27 PM 9/23/00 +0200, Louis-David Mitterrand wrote:
>Hello,
>
>Approaching completion of an online auction system based on Postgres and
>mod_perl/Apache I yet have to devise a good way of running certain
>maintenance tasks on the DB like closing auctions, notifying winners,
>transferring old records to archive tables, etc.
>
>What is the usual way of programming such tasks? Write a backend
>function (in pl/sql or C) and call it from a cron job? From a mod_perl
>handler?
>
>Thanks in advance for any insight, cheers,
>
>--
>Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.org