Forum OpenACS Q&A: Re: Help on cronjob ...

Collapse
2: Re: Help on cronjob ... (response to 1)
Posted by Tom Jackson on

Well some folks updated my cronjob package, but made a small error. The sql was removed from the tcl/cronjob-procs.tcl file and put into an xql file, but the $sql variable was left in place, explaining the error.

I fixed it and committed the changes to cvs. I also fixed another bug that didn't allow the day-of-week to display correctly on the cronjob page.

I'm not exactly sure how you can checkout just the changes, but if you used cvs to get the original version, just do a cvs update in the cronjob package directory should work.

Otherwise I can try to package it and mail it to you.

Your other question was: what does the sql part do. The sql you put in that box will be executed. The result will be formatted as a table with the column headings set to the select column names. If you include an email address, the result html table will be emailed to that address. This is great for running reports at a given time and emailing it to your local manager type. Then the tcl script will be run. Leaving out the sql part has no effect on the tcl script part. If you wanted an email from what the tcl script did, you would have to include a call to ns_sendmail, or something similar, in the tcl script.

Collapse
3: Re: Help on cronjob ... (response to 2)
Posted by Kiran Halwai on
I updated with your new changes. And yes, it worked very nicely. Thanks Tom.

-Kiran
P.S. Few observations:

1. Seems like drop script does not drop everything necessary to clean up the package. I had to do followings -
a) delete from acs_objects where object_type ='cronjob';
b) delete from acs_object_types where object_type = 'cronjob';

2. It would nice to filter out the ^M characters from the TCL section text. My script failed because of the ^M characters.