Run Periodic Tasks with vovliveness
If the directory "tasks" exist in the Server Working Directory, the server calls the vovliveness script once per minute.
The script executes all the tasks contained in the "tasks" directory.
vovliveness: Usage Message
DESCRIPTION:
This script is called by vovserver about once a minute.
It can be used to perform maintenance tasks.
USAGE:
% vovliveness [OPTIONS] <taskdirectory> <timestamp>
WHERE:
task_directory -- is the directory with the tasks
to be executed. The tasks are those
that match the expression "live_*.tcl".
timestamp -- Currently ignored.
OPTIONS:
-v -- Increase verbosity.
There are many uses for vovliveness. Examples are available in the directory $VOVDIR/etc/liveness.
% cd `vovserverdir -p .`
% mkdir tasks
% cd tasks
% cp $VOVDIR/etc/liveness/live_start_taskers.tcl .
#
# Copyright © 2007-2021, Altair Engineering
#
# All Rights Reserved.
#
# Directory : src/scripts/liveness
# File : live_start_taskers.tcl
# Content : Start down taskers once an hour.
# Note :
#
# $Id: //vov/branches/2019.01/src/scripts/liveness/live_start_taskers.tcl#3 $
#
set now [clock seconds]
# Get or initialize period
if { [catch {set period [vtk_prop_get 1 LIVE_START_TASKERS_PERIOD]}] } {
set period 3600
catch {vtk_prop_set 1 LIVE_START_TASKERS_PERIOD $period}
}
# Get age
if { [catch {set lastRun [vtk_prop_get 1 LIVE_START_TASKERS_LAST]}] } {
set lastRun 0
}
set age [expr {$now - $lastRun}]
if { $age >= $period } {
# Start down taskers
if { [catch {exec vovtaskermgr start >&@ stdout} errmsg] } {
VovError "Failed to start taskers: $errmsg"
}
# Reset the last run TS
catch {vtk_prop_set 1 LIVE_START_TASKERS_LAST $now}
}
Alerts from Liveness Tasks
The liveness tasks system is designed to support short jobs that are triggered frequently (about once per minute) by the vovserver so long as it is running. It was also used for the database loading task for Monitor checkouts and Accelerator jobs; sometimes these jobs run significantly longer.
In later releases the debuglog parsing, batch reports and other maintenance items are converted to periodic jobs that run on a dedicated vovtasker named 'maintainer', so these alerts should no longer appear.