You are here

README.txt in Ultimate Cron 7.2

Same filename and directory in other branches
  1. 8.2 README.txt
  2. 8 README.txt
  3. 6 README.txt
  4. 7 README.txt
Credits
-------

Thanks to Mark James for the icons
  http://www.famfamfam.com/lab/icons/silk/


Example code:


// Default cron-function, configurable through /admin/config/system/cron
function mymodule_cron() {
  // Do some stuff ...
}


// Define custom cron functions.
function mymodule_cronapi($op, $job = NULL) {
  return array(
    'mymodule_cronjob_1' => array(
      'title' => 'Cron-1 Handler',
      'scheduler' => array(
        'name' => 'crontab',
        'crontab' => array(
          'rules' => array('*/13 * * * *'),
        ),
      ),
    ),
    'mymodule_cronjob_2' => array(
      'title' => 'Cron-2 Handler',
      'callback' => 'mymodule_somefunction',
      'scheduler' => array(
        'name' => 'crontab',
        'crontab' => array(
          'rules' => array('0 0 1 * *'),
        ),
      ),
    ),
    'mymodule_cronjob_3' => array(
      'title' => 'Cron-3 Handler',
    ),
  );
}

// Custom cron-function
function mymodule_cronjob_1($job) {
  // Do some stuff ...
}

// Custom cron-function
function mymodule_somefunction($job) {
  // Do some stuff ...
}

// Custom cron-function
function mymodule_cronjob_3($job) {
  // Do some stuff ...
}

// Easy-hook, uses rule: 0+@ * * * *
function mymodule_cron_hourly($job) {
  // Do some stuff
}

// Easy-hook, uses rule: 0+@ 12 * * *
function mymodule_cron_daily($job) {
  // Do some stuff
}

// Easy-hook, uses rule: 0+@ 0 * * *
function mymodule_cron_nightly($job) {
  // Do some stuff
}

// Easy-hook, uses rule: 0+@ 0 * * 1
function mymodule_cron_weekly($job) {
  // Do some stuff
}

// Easy-hook, uses rule: 0+@ 0 1 * *
function mymodule_cron_monthly($job) {
  // Do some stuff
}

// Easy-hook, uses rule: 0+@ 0 1 1 *
function mymodule_cron_yearly($job) {
  // Do some stuff
}


File

README.txt
View source
  1. Credits
  2. -------
  3. Thanks to Mark James for the icons
  4. http://www.famfamfam.com/lab/icons/silk/
  5. Example code:
  6. // Default cron-function, configurable through /admin/config/system/cron
  7. function mymodule_cron() {
  8. // Do some stuff ...
  9. }
  10. // Define custom cron functions.
  11. function mymodule_cronapi($op, $job = NULL) {
  12. return array(
  13. 'mymodule_cronjob_1' => array(
  14. 'title' => 'Cron-1 Handler',
  15. 'scheduler' => array(
  16. 'name' => 'crontab',
  17. 'crontab' => array(
  18. 'rules' => array('*/13 * * * *'),
  19. ),
  20. ),
  21. ),
  22. 'mymodule_cronjob_2' => array(
  23. 'title' => 'Cron-2 Handler',
  24. 'callback' => 'mymodule_somefunction',
  25. 'scheduler' => array(
  26. 'name' => 'crontab',
  27. 'crontab' => array(
  28. 'rules' => array('0 0 1 * *'),
  29. ),
  30. ),
  31. ),
  32. 'mymodule_cronjob_3' => array(
  33. 'title' => 'Cron-3 Handler',
  34. ),
  35. );
  36. }
  37. // Custom cron-function
  38. function mymodule_cronjob_1($job) {
  39. // Do some stuff ...
  40. }
  41. // Custom cron-function
  42. function mymodule_somefunction($job) {
  43. // Do some stuff ...
  44. }
  45. // Custom cron-function
  46. function mymodule_cronjob_3($job) {
  47. // Do some stuff ...
  48. }
  49. // Easy-hook, uses rule: 0+@ * * * *
  50. function mymodule_cron_hourly($job) {
  51. // Do some stuff
  52. }
  53. // Easy-hook, uses rule: 0+@ 12 * * *
  54. function mymodule_cron_daily($job) {
  55. // Do some stuff
  56. }
  57. // Easy-hook, uses rule: 0+@ 0 * * *
  58. function mymodule_cron_nightly($job) {
  59. // Do some stuff
  60. }
  61. // Easy-hook, uses rule: 0+@ 0 * * 1
  62. function mymodule_cron_weekly($job) {
  63. // Do some stuff
  64. }
  65. // Easy-hook, uses rule: 0+@ 0 1 * *
  66. function mymodule_cron_monthly($job) {
  67. // Do some stuff
  68. }
  69. // Easy-hook, uses rule: 0+@ 0 1 1 *
  70. function mymodule_cron_yearly($job) {
  71. // Do some stuff
  72. }