You are here

README.txt in Ultimate Cron 6

Same filename and directory in other branches
  1. 8.2 README.txt
  2. 8 README.txt
  3. 7.2 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/build/cron/settings
function mymodule_cron() {
  // Do some stuff ...
}


// Define custom cron functions
function mymodule_cronapi($op, $job = NULL) {
  switch($op) {
    case 'list':
      return array(
        'mymodule_cronjob_1' => 'Cron-1 Handler',
        'mymodule_cronjob_2' => 'Cron-2 Handler',
        'mymodule_cronjob_3' => 'Cron-3 Handler',
      );

    case 'rule':
      switch($job) {
        case 'mymodule_cronjob_1': return '*/13 * * * *';
        case 'mymodule_cronjob_2': return '0 0 1 * *';
      );

    case 'execute':
      switch($job) {
        case 'mymodule_cronjob_2':
          mymodule_somefunction();
          break;
      }

  }
}

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

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

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

// Easy-hook, uses rule: 0 * * * *
function mymodule_hourly() {
  // Do some stuff
}

// Easy-hook, uses rule: 0 0 * * *
function mymodule_daily() {
  // Do some stuff
}

// Easy-hook, uses rule: 0 0 * * 1
function mymodule_weekly() {
  // Do some stuff
}

// Easy-hook, uses rule: 0 0 1 * *
function mymodule_monthly() {
  // Do some stuff
}

// Easy-hook, uses rule: 0 0 1 1 *
function mymodule_yearly() {
  // 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/build/cron/settings
  7. function mymodule_cron() {
  8. // Do some stuff ...
  9. }
  10. // Define custom cron functions
  11. function mymodule_cronapi($op, $job = NULL) {
  12. switch($op) {
  13. case 'list':
  14. return array(
  15. 'mymodule_cronjob_1' => 'Cron-1 Handler',
  16. 'mymodule_cronjob_2' => 'Cron-2 Handler',
  17. 'mymodule_cronjob_3' => 'Cron-3 Handler',
  18. );
  19. case 'rule':
  20. switch($job) {
  21. case 'mymodule_cronjob_1': return '*/13 * * * *';
  22. case 'mymodule_cronjob_2': return '0 0 1 * *';
  23. );
  24. case 'execute':
  25. switch($job) {
  26. case 'mymodule_cronjob_2':
  27. mymodule_somefunction();
  28. break;
  29. }
  30. }
  31. }
  32. // Custom cron-function
  33. function mymodule_cronjob_1() {
  34. // Do some stuff ...
  35. }
  36. // Custom cron-function
  37. function mymodule_somefunction() {
  38. // Do some stuff ...
  39. }
  40. // Custom cron-function
  41. function mymodule_cronjob_3() {
  42. // Do some stuff ...
  43. }
  44. // Easy-hook, uses rule: 0 * * * *
  45. function mymodule_hourly() {
  46. // Do some stuff
  47. }
  48. // Easy-hook, uses rule: 0 0 * * *
  49. function mymodule_daily() {
  50. // Do some stuff
  51. }
  52. // Easy-hook, uses rule: 0 0 * * 1
  53. function mymodule_weekly() {
  54. // Do some stuff
  55. }
  56. // Easy-hook, uses rule: 0 0 1 * *
  57. function mymodule_monthly() {
  58. // Do some stuff
  59. }
  60. // Easy-hook, uses rule: 0 0 1 1 *
  61. function mymodule_yearly() {
  62. // Do some stuff
  63. }