Index

(jobs)

o2job_schedule

integer o2job_schedule(string $job_name, string $type, integer $interval, string $date, string $time, string $recurrence, string $week_day, integer $month_day, string $aspid, boolean $all_hosts)

Schedule job with passed name.

A scheduled job is a task.
A task can be of one of 3 types (char(1) passed as $type):
"O": Once Task is run once in day $date at time $time
"I": Interval Task is run once every $interval minutes
"R": Recurrence Task is run with a defined recurrence (see below)

In case of recurrence, $recurrence parameter can take value:
"D": Day Task in run once every day at $time
"W": Week Task in run once every week at $week_day (see below)
"M": Month Task in run once every month, day $month_day (see below)

Parameters $date and $time are passed in Janox format ("yyyymmdd", "hhmmss").

Parameter $week_day (char(3)) can take value:
"Mon|Tue|Wed|Thu|Fri|Sat|Sun": Day of week

Parameter $month_day (integer) can take value:
1-31: Day of month

If task is correctly created new tasl-ID is returned, else FALSE.


Parameters:
  1. $job_name
  2. Name to look for
  3. $type
  4. Task type: [O]nce, [I]nterval, [R]ecurrence
  5. $interval
  6. For type [I]nterval: number of minutes
  7. $date
  8. For type [O]nce & [R]ecurrence: Janox format date
  9. $time
  10. For type [O]nce & [R]ecurrence: Janox format time
  11. $recurrence
  12. Recurrence type: [D]ay, [W]eek, [M]onth
  13. $week_day
  14. Day of week [Mon|Tue|Wed|Thu|Fri|Sat|Sun]
  15. $month_day
  16. Day of month [0-31]
  17. $aspid
  18. ASPI-ID to run job for
  19. $all_hosts
  20. Run job on all active hosts
Related functions:

o2job_create

o2job_get_by_name

o2job_run

o2job_is_running