About

Simple API for scheduling tasks once at a predetermined time or periodically at a fixed interval.

Usage

Declare scheduler.

function example_cron_job_scheduler_info() { $schedulers - array(); $schedulers['example_unpublish'] - array( 'worker callback' -> 'example_unpublish_nodes', ); return $schedulers; }

Add a job.

$job - array( 'type' -> 'story', 'id' -> 12, 'period' -> 3600, 'periodic' -> TRUE, ); JobScheduler::get('example_unpublish')->set($job);

Work off a job.

function example_unpublish_nodes($job) { // Do stuff. }

Remove a job.

$job - array( 'type' -> 'story', 'id' -> 12, ); JobScheduler::get('example_unpublish')->remove($job);

Optionally jobs can declared together with a schedule in a: hook_cron_job_scheduler_info().

function example_cron_job_scheduler_info() { $schedulers - array(); $schedulers['example_unpublish'] - array( 'worker callback' -> 'example_unpublish_nodes', 'jobs' -> array( array( 'type' -> 'story', 'id' -> 12, 'period' -> 3600, 'periodic' -> TRUE, ), ) ); return $schedulers; }

Jobs can have a 'crontab' instead of a period. Crontab syntax are Unix-like formatted crontab lines.

Example of job with crontab.

This will create a job that will be triggered from monday to friday, from january to july, every two hours.

function example_cron_job_scheduler_info() { $schedulers - array(); $schedulers['example_unpublish'] - array( 'worker callback' -> 'example_unpublish_nodes', 'jobs' -> array( array( 'type' -> 'story', 'id' -> 12, 'crontab' -> '0 */2 * january-july mon-fri', 'periodic' -> TRUE, ), ) ); return $schedulers; }

Read more about crontab syntax: http://linux.die.net/man/5/crontab

ĐƯỜNG DÂY NÓNG

Điện thoại:  +84-(0)24.37683191
+84-(0)914689576
Thời gian tiếp công dân:  Từ thứ 2 đến thứ 6 hàng tuần
- Sáng từ: 8 giờ 00 phút đến 11 giờ 30 phút
- Chiều từ: 13 giờ 30 phút đến 17 giờ 00 phút.
Lịch tiếp công dân:  - Cục trưởng Cục Hàng hải Việt Nam tiếp công dân định kỳ một ngày trong một tháng vào ngày thứ Hai của tuần cuối tháng
- Cán bộ được giao nhiệm vụ tiếp công dân thực hiện tiếp công dân từ thứ 2 đến thứ 6 hàng tuần.

HÌNH ẢNH & VIDEO

LIÊN KẾT WEBSITE

THỐNG KÊ TRUY CẬP

    • Tổng số :21669071
    • Online: 69