Index: openacs-4/packages/cronjob/cronjob.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/cronjob.info,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/cronjob/cronjob.info 11 Dec 2003 21:40:01 -0000 1.7
+++ openacs-4/packages/cronjob/cronjob.info 29 May 2009 09:02:11 -0000 1.8
@@ -5,50 +5,18 @@
CronjobCronjobsf
- f
+ t
-
-
- oracle
- postgresql
-
- Tom Jackson
- Run sql and tcl code on schedule, similar to unix cron.
- Runs sql and tcl code on schedule similar to unix cron. Some issues exist with
- guaranteed execution and blocking.
+
+ Tom Jackson
+ Runs sql and tcl code on schedule similar to unix cron.
+ 2007-02-12
+ Runs sql and tcl code on schedule similar to unix cron.
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
Index: openacs-4/packages/cronjob/tcl/cronjob-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/tcl/cronjob-procs.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/cronjob/tcl/cronjob-procs.tcl 1 Nov 2003 08:45:38 -0000 1.7
+++ openacs-4/packages/cronjob/tcl/cronjob-procs.tcl 29 May 2009 09:02:11 -0000 1.8
@@ -1,7 +1,7 @@
ad_library {
- Cronjog support procs
+ Cronjob support procs
- @author Tom Jackson
+ @author Tom Jackson
@creation-date 22 Sept 2001
@cvs-id $Id$
@@ -22,7 +22,7 @@
set dayofweek [ns_fmttime $time %w]
db_foreach cronjob_sched_foreach "" {
- ad_schedule_proc -once t -thread t 1 cronjob_run $cronjob_id
+ ad_schedule_proc -once t -thread t 1 cronjob_run $cronjob_id
}
}
@@ -33,46 +33,47 @@
Proc to run cronjobs
} {
+ # To avoid errors
+ set rownum 0
+
+
set table "No SQL"
- ns_log Debug "cronjob_run: Cronjob_id is $cronjob_id"
+ ns_log Debug "Cronjob_id is $cronjob_id $rownum"
db_1row cronjob_query {}
db_release_unused_handles
if {![string match "" $run_sql]} {
- set table "
"
- set db [ns_db gethandle "log"]
- set sel [ns_db select $db $run_sql]
- set rownum 0
- if {![string match "" $sel]} {
- while {[ns_db getrow $db $sel]} {
- set size [ns_set size $sel]
- if {$rownum == 0} {
- for {set i 0 } {$i < $size} {incr i} {
- append table "\n
[ns_set key $sel $i]
"
- }
- }
- append table "
"
- for {set i 0 } {$i < $size} {incr i} {
- append table "\n
[ns_set value $sel $i]
"
- }
- append table "
"
- incr rownum
- }
- }
- append table "
"
- if {$rownum == 0} {
- set table "No Rows Returned"
- }
- ns_db releasehandle $db
+ set rownum 0
+ set table "
"
+ db_foreach cronjob_run_sql $run_sql -column_set row {
+
+ set size [ns_set size $row]
+ if {$rownum == 0} {
+ for {set i 0 } {$i < $size} {incr i} {
+ append table "\n
[ns_set key $row $i]
"
+ }
+ }
+ append table "
"
+ for {set i 0 } {$i < $size} {incr i} {
+ append table "\n
[ns_set value $row $i]
"
+ }
+ append table "
"
+ incr rownum
+ }
}
+ append table "
"
+ if {$rownum == 0} {
+ set table "No Rows Returned"
+ }
+
# evaluate the run_tcl code
eval $run_tcl
if {![string match "" $email]} {
- ns_log Debug "cronjob_run: sending cronjob email to $email"
- set headers [ns_set create]
- ns_set put $headers "Content-Type" "text/html"
- ns_sendmail $email [ad_host_administrator] "Cronjob $cronjob_id" "Description: $description $table" $headers
+ ns_log Debug "sending cronjob email to $email"
+ set headers [ns_set create]
+ ns_set put $headers "Content-Type" "text/html"
+ ns_sendmail $email [ad_host_administrator] "Cronjob $cronjob_id" "Description: $description $table" $headers
}
return
Index: openacs-4/packages/cronjob/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cronjob/www/index.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/cronjob/www/index.adp 22 May 2003 14:39:12 -0000 1.2
+++ openacs-4/packages/cronjob/www/index.adp 29 May 2009 09:02:11 -0000 1.3
@@ -1,10 +1,10 @@
-
- @title;noquote@
- @context;noquote@
-
-