Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/spst/UnixTransition/doc/submit_codine.html
Дата изменения: Fri Apr 8 12:46:15 2016
Дата индексирования: Mon Apr 11 02:48:27 2016
Кодировка:

Поисковые слова: fire
Python: module submit_codine
 
 
submit_codine (version 15.01.07)
index
submit_codine.py

PURPOSE --
A low-level routine for submitting periodic batch jobs to the
Sun Grid Engine (SGE).
 
DEVELOPER --
Don Chance
 
MODIFICATION HISTORY --
Initial implementation  7/31/01
Modified to support non-periodic submissions.  drc 11/12/01
Raise an error when the resubmission doesn't work.  drc 2/25/02
Change spss_sys_util.command to os.system when resubmitting the batch
job.  drc 3/6/02
Mods to provide a lot more information if qsub fails.  mdr 3/7/02
Mod so next execution time is localtime of machine running job.  mdr 8/24/10
Use time rather than time_util to handle machine localtime.  mdr 9/7/10
Enhance -period, add cron option add a submit-only option mdr 10/7/10
Change to switches for each cron time field mdr 10/8/10
Update for Python 3 compatiblity and verision 3.0 of APScheduler.  drc 9/29/14
More updates for operating on Linux with newer APScheduler version drc 1/7/15

 
Modules
       
datetime
os
pytz
spss_sys_util
time

 
Functions
       
run(*args)
Submit a periodic batch job to Codine.
 
do submit_codine -period <sec> [-sts | -ets]
                 -cron [[-year <val>][-month <val>][-day <val>][-week <val>]
                        [-day_of_week <val>][-hour <val>][-minute <val>]
                        [-second <val]] 
                 [-subonly]
                 [-dir <path>]
                 -qsub <qsub_arg1> <qsub_arg2> ... <qsub_argn>
                 -tool <tool_name> <tool_arg1> <tool_arg2> ... <tool_argn>
 
Note: The argument names (period, cron, qsub, tool, dir, sts, ste, subonly) 
MUST NOT be abbreviated, as the full names are important for distinguishing
between submit_codine's arguments and those for qsub and the tool.
 
The argument -tool is required and may only appear after -qsub.
Any data after the -tool is assumed to be the tool name and its
arguments.
 
All arguments between -qsub and -tool are assumed to be arguments
for the SGE qsub command.
 
-period specifies the time (in seconds) to leave between
this execution and the beginning of the next.  If "-period 0",
then the batch job executes only once.
  -sts indicates the -period should be applied from job start to
  job start.
  -ets indicates the -period should be applied from the job end to
  job start (default).
  Note: -sts and -ets are mutually exclusive.
 
-cron uses a cron-like time specification as to when the job should
fire.
  The following switches allow for various time specified firings
  (any unspecified switch will default to fire on every value unless
  noted otherwise).
  A cron with no time specification at all will be a job which will 
  fire every minute on the minute.
 
  -year   = 4-digit year number
  -month  = month number (1-12)
  -day    = day of the month (1-31)
  -week   = ISO week number (1-53)
  -day_of_week = number or name of weekday (0-6 or mon,tue,wed,thu,fri,sat,sun)
  -hour   = hour (0-23)
  -minute = minute (0-59) (default = 0)
 
  The following values/expressions are allowed in each of the above -cron time switches:
  Exp     Field  Description
  a-b     any    Fire on any value within the a-b range (a must be smaller than b)
  a-b/c   any    Fire every c values within the a-b range
  xth_y   day    Fire on the x-th occurrence of weekday y within the month
  last_x  day    Fire on the last occurrence of weekday x within the month
  x,y,z   any    Fire on any matching expression; can combine any number of any of the above expressions
 
Note: -period and -cron are mutually exclusive.
 
-subonly specifies to only submit the job.  This allows for use of
submit_codine.py from within a batch job to run a tool as a
separate batch job rather than inline.
 
-dir specifies the working directory to use when executing the
tool. The working directory defaults to the current working
directory from which submit_codine is executed.

 
Data
        TZ = <DstTzInfo 'US/Eastern' LMT-1 day, 19:04:00 STD>
__version__ = '15.01.07'
cronversion = 1