48 lines
1.1 KiB
PHP
Executable File
48 lines
1.1 KiB
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
/**
|
|
* Horde cron daemon. Cron
|
|
*
|
|
* Copyright 2003-2017 Horde LLC (http://www.horde.org/)
|
|
*
|
|
* See the enclosed file COPYING for license information (LGPL-2). If you
|
|
* did not receive this file, see http://www.horde.org/licenses/lgpl.
|
|
*
|
|
* @category Horde
|
|
* @license http://www.horde.org/licenses/lgpl LGPL-2
|
|
* @package Horde
|
|
*/
|
|
|
|
// Configuration
|
|
|
|
// Tasks configuration.
|
|
// KEY: scriptname
|
|
// VALUE: crontab definition
|
|
$cron_tasks = array(
|
|
// Basic example: list files at xx:00, xx:05, xx:10, and xx:20
|
|
// '/bin/ls' => '0,5,10,15,20 * * * *'
|
|
);
|
|
|
|
// End Configuration
|
|
|
|
$baseFile = __DIR__ . '/../lib/Application.php';
|
|
if (file_exists($baseFile)) {
|
|
require_once $baseFile;
|
|
} else {
|
|
require_once 'PEAR/Config.php';
|
|
require_once PEAR_Config::singleton()
|
|
->get('horde_dir', null, 'pear.horde.org') . '/lib/Application.php';
|
|
}
|
|
Horde_Registry::appInit('horde', array('cli' => true));
|
|
|
|
// Get an instance of the cron scheduler.
|
|
$daemon = Horde_Scheduler::factory('Cron');
|
|
|
|
// Add cron tasks.
|
|
foreach ($cron_tasks as $key => $val) {
|
|
$daemon->addTask($key, $val);
|
|
}
|
|
|
|
// Start the daemon going.
|
|
$daemon->run();
|