(file) Return to add_coverage_update CVS log (file) (dir) Up to [Development] / JSOC / proj / workflow / add_scripts

File: [Development] / JSOC / proj / workflow / add_scripts / add_coverage_update (download)
Revision: 1.1, Wed Jan 5 20:40:20 2011 UTC (12 years, 1 month ago) by phil
Branch: MAIN
CVS Tags: Ver_LATEST, Ver_9-5, Ver_9-41, Ver_9-4, Ver_9-3, Ver_9-2, Ver_9-1, Ver_9-0, Ver_8-8, Ver_8-7, Ver_8-6, Ver_8-5, Ver_8-4, Ver_8-3, Ver_8-2, Ver_8-12, Ver_8-11, Ver_8-10, Ver_8-1, Ver_8-0, Ver_7-1, Ver_7-0, Ver_6-4, Ver_6-3, Ver_6-2, Ver_6-1, Ver_6-0, Ver_5-14, Ver_5-13, HEAD
Initial checkin

#! /bin/csh -f

#
# WARNING - do not run this while gatekeeper is active if it is updating an existing gate/task pair

# script to add a repeating processing to make e.g. to run a task each day.
# When it starts it will send a restart ticket to be restarted a fixed time later.
# The statustask is basically a nop
# The actiontask has a precondition of the full range of times in the calling ticket.
# The precondition ticket is to the clock_gate with a wait until ready action == 3.
# The command script first sends a ticket to its own gate to create the next interval
# then it does the desired action, which may be a maketicket or any other shell command
# computing.  It waits for the processing to be done but not for the repeat ticket.

# the case here is used like cron

set WFDIR = $WORKFLOW_DATA
set WFCODE = $WORKFLOW_ROOT
cd $WFDIR

set NEWTASK = repeat_web_show_coverage_task
set NEWGATE = repeat_web_show_coverage
set COMMANDSCRIPT = scripts/repeat_web_show_coverage.csh

# remove prior test version

if (-e tasks/$NEWTASK) rm -rf tasks/$NEWTASK
if (-e gates/$NEWGATE) rm -rf gates/$NEWGATE

# Parameters to control repeat timing
# REPEAT is wait time for next run of command
# set REPEAT = 7200

# make the actiontask command that will start processing when current wait interval ends
# cat >$WFCODE/scripts/$COMMANDSCRIPT << ENDSCRIPT
# #! /bin/csh -f
# set NOW = \`date -u +%Y.%m.%d_%H:%M:%S\`
# set NOW_t = \`time_convert time=\$NOW\`
# @ NEXTWANTHIGH_t = \$NOW_t + $REPEAT 
# set NEXTWANTHIGH = \`time_convert s=\$NEXTWANTHIGH_t\`
# set NEXTWANTLOW = \$NOW
# $WFCODE/maketicket.csh gate=$NEWGATE wantlow=\$NEXTWANTLOW wanthigh=\$NEXTWANTHIGH action=5
# #
# # now do the desired command(s)
# /web/jsoc/htdocs/doc/data/hmi/coverage_tables/update_coverage
# # /web/jsoc/htdocs/doc/data/hmi_test/update_coverage
# /web/jsoc/htdocs/doc/data/aia/update_coverage
# # /web/jsoc/htdocs/doc/data/aia_test/update_coverage
# /web/jsoc/htdocs/doc/data/mdi/update_coverage
# exit 0
# ENDSCRIPT


# finally make task 
maketask.csh task=$NEWTASK \
		manager=taskmanager.csh \
		target=$NEWGATE \
		maxrange=8640000 \
                command=$COMMANDSCRIPT

# set the precondition ticket to wait for the end of the current interval
mkdir tasks/$NEWTASK/preconditions/clock_gate
echo "set ACTION=3" >tasks/$NEWTASK/preconditions/clock_gate/prepare_ticket

makegate.csh gate_name=$NEWGATE \
		 product=none \
		 type=time \
		 key=NA \
		 low=1993.01.01_00:00:00_TAI \
		 high=1993.01.01_00:00:00_TAI \
		 actiontask=$NEWTASK \
		 statustask=scripts/status_clock.csh

# initialization ticket not needed. 


Karen Tian
Powered by
ViewCVS 0.9.4