You are here

function backup_migrate_cronapi in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 backup_migrate.module \backup_migrate_cronapi()
  2. 7.3 backup_migrate.module \backup_migrate_cronapi()

Implementation of hook_cronapi().

File

./backup_migrate.module, line 249
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (e.g. cache_*)

Code

function backup_migrate_cronapi($op, $job = NULL) {
  $items = array();
  backup_migrate_include('schedules');
  foreach (backup_migrate_get_schedules() as $schedule) {
    if ($schedule
      ->get('cron') == BACKUP_MIGRATE_CRON_ELYSIA) {
      $id = $schedule
        ->get('id');
      $items['backup_migrate_' . $id] = array(
        'description' => t('Run the Backup and Migrate \'!name\' schedule', array(
          '!name' => $schedule
            ->get('name'),
        )),
        'rule' => $schedule
          ->get('cron_schedule'),
        'callback' => 'backup_migrate_schedule_run',
        'arguments' => array(
          $id,
        ),
        'file' => 'includes/schedules.inc',
      );
    }
  }
  return $items;
}