Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NameDescriptionExecution time
advance_workflow.phpThis cronjob activates the next workflow step if the time limit is over-
linkchecker.phpChecks all links#02 1 * * * // deactivated with #
move_articles.phpMove articles at specified time

*/1 * * * * (periodically every minute)

move_old_stats.phpThis cronjob is used to move old statistics into the stat_archive table0 0 1 * *  (every first day in the month at midnight)
optimize_database.phpThis cronjob optimizes all database tables0 0 * * *  (every full hour)
run_newsletter_job.phpCronjob for newsletter plugin-
send_reminder.phpCronjob to send the reminder items.

*/5 * * * * (periodically every 5 minutes)

setfrontenduserstate.php Activate/deactivate frontend users by time.*/5 * * * * (periodically every 5 minutes)

...

Adding new cronjobs

To add a new cronjob you have to create a new cronjob file (use the template below if you want) and configure it´s execution period at the 'data/cronlog/

Adding new cronjob

CRONJOBPLUGINcrontab.txt' file.

Cronjob plugin

The CONTENIDO cronjob plugin (default: not installed) provides information about the cronjobs and the possibility to to configure the cronjobs in the backend mode. A further feature is to start a cronjob manually.

Cronjob template:

Anchor
template
template

Code Block
languagephp
<?php
/**
 * Template cronjob file
 *
 * @package    Core
 * @subpackage Cronjob
 *
 * @author     claus.schunk@4fb.de
 * @copyright  four for business AG <www.4fb.de>
 * @license    http://www.contenido.org/license/LIZENZ.txt
 * @link       http://www.4fb.de
 * @link       http://www.contenido.org
 */

if (!defined('CON_FRAMEWORK')) {
    define('CON_FRAMEWORK', true);
}

// CONTENIDO path
$contenidoPath = str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')) . '/';

// CONTENIDO startup process
include_once($contenidoPath . 'includes/startup.php');

require_once(cRegistry::getBackendPath() . $cfg['path']['includes'] . 'pseudo-cron.inc.php');

if (!isRunningFromWeb() || function_exists('runJob') || $area == 'cronjobs') {
	
	//implement your code here
}
?>

...