in reply to File Loader (load the content of a file and insert into DB)

As long as your app is ok with the one-minute delay, I'd just use the crontab. The advantages are:

- don't have to worry about what happens if your service dies, or setting it up so that it starts automatically if the box reboots

- you get email notification of errors for free (assuming that you're checking the email of that user's crontab)

I'm not sure what you mean by "loaders". Do you mean a database API? You probably want DBD::Oracle.

-b

  • Comment on Re: File Loader (load the content of a file and insert into DB)

Replies are listed 'Best First'.
Re^2: File Loader (load the content of a file and insert into DB)
by jordanh (Chaplain) on May 20, 2005 at 21:34 UTC

    There are definitely pitfalls of using cron for this kind of thing for production code. Particularly when the cycles are short.

    You should consider what will happen if the task takes longer than the period you've set it to run from cron. If it's bad for overlapping runs (and it usually is, if for nothing else downward performance spirals when the system gets REALLY busy). Various locking schemes are possible to avoid the problems of overlapping runs, but most of them are trickier than it would seem at first and there are various race conditions to be considered.

    But, you make good points about the simplicity of a crontab-based solution.