Note: You are currently viewing documentation for Moodle 2.8. Up-to-date documentation for the latest stable version of Moodle may be available here: Scheduled tasks.

Scheduled tasks: Difference between revisions

From MoodleDocs
No edit summary
('Next run' column improvement in 2.8.3 onwards (MDL-48383))
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Server settings}}
{{Server settings}}
{{New features}}


An administrator can schedule routine tasks very precisely from ''Administration>Site administration>Server>Scheduled tasks.''
An administrator can schedule routine tasks very precisely from ''Administration > Site administration > Server > Scheduled tasks.''


(Note that you still need to run the CRON scripts (\admin\cli\cron.php or http:\\yoursite\admin\cron.php) at regular intervals.The script is best run every minute.)
Note that you still need to run the [[Cron|CRON scripts]] (\admin\cli\cron.php or http:\\yoursite\admin\cron.php) at regular intervals. The script is best run every minute.


[[File:scheduledtasks1.png]]
[[File:scheduledtasks1.png]]
Line 11: Line 10:


[[File:scheduledtasks2.png]]
[[File:scheduledtasks2.png]]
New scheduled tasks in Moodle 2.8 onwards are:
* Update all installed language packs
* Cleanup of unverified incoming email
* Incoming email pickup
* Removing any unnecessary event monitor events
In Moodle 2.8.3 onwards, the column 'Next run' provides information on whether a plugin or a task is disabled (as well as the date that a task will next run).


==Format for scheduling tasks==
==Format for scheduling tasks==
Line 23: Line 31:
  2,5 is the second and 5th of the month, or February and May, or Tuesday and Friday.
  2,5 is the second and 5th of the month, or February and May, or Tuesday and Friday.


==See also==
==Fail Delay==
<mediaplayer>http://youtu.be/zPE3WdKppJI</mediaplayer>
 
If you're trying to debug a cron task, you may notice the Fail Delay becomes populated with a number. This is the time in seconds the cron will delay running the task. To sidestep this problem for development purposes, take a look at the Scheduled Tasks section here: [[Administration_via_command_line#Scheduled_tasks]]
 
[[es:Tareas agendadas]]
[[es:Tareas agendadas]]
[[de:Geplante Vorgänge]]
[[de:Geplante Vorgänge]]

Latest revision as of 16:46, 24 February 2015


An administrator can schedule routine tasks very precisely from Administration > Site administration > Server > Scheduled tasks.

Note that you still need to run the CRON scripts (\admin\cli\cron.php or http:\\yoursite\admin\cron.php) at regular intervals. The script is best run every minute.

scheduledtasks1.png

Clicking the edit icon allows the administrator to specify the minute/hour/day/month or day of the week the task is to be run. It is also possible to reset the task to its default setting or disable it completely.

scheduledtasks2.png

New scheduled tasks in Moodle 2.8 onwards are:

  • Update all installed language packs
  • Cleanup of unverified incoming email
  • Incoming email pickup
  • Removing any unnecessary event monitor events

In Moodle 2.8.3 onwards, the column 'Next run' provides information on whether a plugin or a task is disabled (as well as the date that a task will next run).

Format for scheduling tasks

When typing into the fields, the format is the same as for Unix cron. Examples are as follows and are according to which field you are editing:

* is every minute, hour, day, month
*/2 is every two minutes, every two hours or every second day
2-10 is every minute between two and ten past the hour or every hour between 2 and 10 am 
0 is every Sunday
1 is every Monday or every January
2,5 is the second and 5th of the month, or February and May, or Tuesday and Friday.

Fail Delay

If you're trying to debug a cron task, you may notice the Fail Delay becomes populated with a number. This is the time in seconds the cron will delay running the task. To sidestep this problem for development purposes, take a look at the Scheduled Tasks section here: Administration_via_command_line#Scheduled_tasks