I'm using PHP, Oracle and crontab. Crontab is invoking a php script, which is going to synchronize some data between a local and remote database.
First I thought about putting this all in one large, anonymous inline PL/SQL block and executing it in PHP. The problem is that without creating a table to audit the procedure it's really opaque to my PHP code until it returns. And then when it does return, the best I can do is receive a string in an out parameter which I've concatenated together as an audit log.
Then I considered breaking it up into several SQL statements and have PHP do some intermediate auditing/logging and manipulation of the data between each of them.
I'm not really satisfied with either of these. How do you organize maintenance code that is called in a cronjob?