You are here

function ultimate_cron_drush_command in Ultimate Cron 7.2

Same name and namespace in other branches
  1. 8.2 ultimate_cron.drush.inc \ultimate_cron_drush_command()
  2. 8 ultimate_cron.drush.inc \ultimate_cron_drush_command()
  3. 6 ultimate_cron.drush.inc \ultimate_cron_drush_command()
  4. 7 ultimate_cron.drush.inc \ultimate_cron_drush_command()

Implements hook_drush_command().

File

./ultimate_cron.drush.inc, line 10
Drush commands for Ultimate Cron!

Code

function ultimate_cron_drush_command() {
  $items = array();
  $items['cron-logs'] = array(
    'description' => "Show a cron jobs logs",
    'arguments' => array(
      'name' => 'Job to show logs for',
    ),
    'options' => array(
      'limit' => 'Number of log entries to show',
      'compact' => 'Only show the first line of each log entry',
    ),
    'examples' => array(
      'drush cron-logs node_cron --limit=20' => 'Show 20 last logs for the node_cron job',
    ),
  );
  $items['cron-list'] = array(
    'description' => "List cron jobs",
    'options' => array(
      'module' => 'Comma separated list of modules to show jobs from',
      'enabled' => 'Show enabled jobs',
      'disabled' => 'Show disabled jobs',
      'behind' => 'Show jobs that are behind schedule',
      'status' => 'Comma separated list of statuses to show jobs from',
      'extended' => 'Show extended information',
      'name' => 'Show name instead of title',
      'scheduled' => 'Show scheduled jobs',
    ),
    'examples' => array(
      'drush cron-list --status=running --module=node' => 'Show jobs from the node module that are currently running',
    ),
    'aliases' => array(
      'cl',
    ),
  );
  $items['cron-job-get'] = array(
    'description' => "Get cron job configuration",
    'arguments' => array(
      'name' => 'Job in question',
    ),
    'options' => array(
      'fallback' => 'Also show fallback settings',
    ),
    'examples' => array(
      'drush cron-job-get node_cron' => 'Get the node_cron job configuration',
    ),
    'aliases' => array(
      'cjget',
    ),
  );
  $items['cron-job-set'] = array(
    'description' => "Set cron job configuration",
    'arguments' => array(
      'name' => 'Job in question',
    ),
    'examples' => array(
      'drush cron-job-set node_cron {"settings":{"scheduler":{"name":"crontab"}}}' => 'Set the node_cron scheduler to "crontab"',
    ),
    'aliases' => array(
      'cjset',
    ),
  );
  $items['cron-run'] = array(
    'description' => "Run cron job",
    'arguments' => array(
      'name' => 'Job to run',
    ),
    'options' => array(
      'force' => 'Only effective when cron-run is run without any arguments. This options skip the schedule check for each job. Locks are still respected. This option is a synonom for --options=bypass_schedule',
      'check-schedule' => 'Checks the schedule when running a single job. The opposite of --force but for a single job only',
      'options' => 'Custom options for plugins, e.g. --options=thread=1 for serial launcher',
    ),
    'examples' => array(
      'drush cron-run node_cron' => 'Run the node_cron job',
      'drush cron-run --options=thread=1' => 'Run all scheduled jobs and instruct serial launcher only to launch thread 1 jobs',
    ),
    'aliases' => array(
      'cr',
    ),
  );
  $items['cron-enable'] = array(
    'description' => "Enable cron job",
    'arguments' => array(
      'name' => 'Job to enable',
    ),
    'options' => array(
      'all' => 'Enable all jobs',
    ),
    'examples' => array(
      'drush cron-enable node_cron' => 'Enable the node_cron job',
    ),
    'aliases' => array(
      'ce',
    ),
  );
  $items['cron-disable'] = array(
    'description' => "Disable cron job",
    'arguments' => array(
      'name' => 'Job to disable',
    ),
    'options' => array(
      'all' => 'Disable all jobs',
    ),
    'examples' => array(
      'drush cron-disable node_cron' => 'Disable the node_cron job',
    ),
    'aliases' => array(
      'cd',
    ),
  );
  $items['cron-unlock'] = array(
    'description' => "Unlock cron job",
    'arguments' => array(
      'name' => 'Job to unlock',
    ),
    'options' => array(
      'all' => 'Unlock all jobs',
    ),
    'examples' => array(
      'drush cron-unlock node_cron' => 'Unlock the node_cron job',
    ),
    'aliases' => array(
      'cu',
    ),
  );
  return $items;
}