[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:general_admin:task_scheduling [2013/10/17 00:18 (UTC)] – uncommented links to non-existent articles and added a note asking or contributions mfillpot | howtos:general_admin:task_scheduling [2015/06/24 14:45 (UTC)] – tdrssb | ||
---|---|---|---|
Line 3: | Line 3: | ||
====== Task Scheduling in Linux ====== | ====== Task Scheduling in Linux ====== | ||
=====Overview===== | =====Overview===== | ||
- | This article discusses some tools used in a Linux system to schedule tasks to run automatically at specified time intervals or at any given point of time in the future. | + | This article discusses some tools used in a Linux system to schedule tasks to run automatically at specified time intervals or at any given point of time in the future. This primer will not cover these commands in-depth; this is just a brief introduction to using these commands. See the individual HOWTOS for each command for an in-depth look at all relevant options and configurations. |
Some task-scheduling daemons used in Linux/UNIX are: | Some task-scheduling daemons used in Linux/UNIX are: | ||
Line 9: | Line 9: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | |||
+ | =====Using at===== | ||
+ | The **//at//** command allows a user to execute commands or scripts at a specified time (required) and date (optional). The commands can be entered via standard input, redirection, | ||
+ | |||
+ | < | ||
+ | darkstar:~% at | ||
+ | </ | ||
+ | |||
+ | =====Interactive at===== | ||
+ | Using the command **//at//** with standard input (keyboard) is a little more complicated than typing one line in at the prompt. The command uses an internal " | ||
+ | |||
+ | < | ||
+ | darkstar:~% at 12:01 -m | ||
+ | warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh | ||
+ | at> ./ | ||
+ | at> <EOT> | ||
+ | job 4 at 2015-06-22 12:01 | ||
+ | darkstar: | ||
+ | </ | ||
+ | |||
+ | =====Using cron===== | ||
+ | |||
+ | **// | ||
+ | |||
+ | **// | ||
+ | |||
+ | < | ||
+ | darkstar:~% crontab -e | ||
+ | </ | ||
+ | |||
+ | To edit the system-level // | ||
+ | |||
+ | < | ||
+ | darkstar:~# crontab -e | ||
+ | </ | ||
+ | |||
+ | If your system has **// | ||
+ | |||
+ | < | ||
+ | darkstar:~% sudo crontab -e | ||
+ | </ | ||
+ | |||
+ | The //crontab// file syntax is: | ||
+ | |||
+ | minute(0-59) hour(0-23) day(1-31) month(1-12) weekday(0-6) command | ||
+ | |||
+ | Using an asterisk in any placeholder location, will match any value. For example, the following will run // | ||
+ | |||
+ | < | ||
+ | #For more information see the manual pages of crontab(5) and cron(8) | ||
+ | # | ||
+ | # min hr day month weekday command | ||
+ | # | ||
+ | # | ||
+ | |||
+ | 0 11 * 1-3 * / | ||
+ | </ | ||
+ | |||
+ | =====Using anacron===== | ||
+ | < | ||
+ | **// | ||
+ | </ | ||
+ | |||
+ | |||
< | < | ||
Line 21: | Line 85: | ||
<!-- Authors are allowed to give credit to themselves! --> | <!-- Authors are allowed to give credit to themselves! --> | ||
* Originally written by [[wiki: | * Originally written by [[wiki: | ||
- | * Contrbutions by [[wiki: | + | * Contrbutions by [[wiki: |
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> | ||
<!-- You must also remove the tag-word " | <!-- You must also remove the tag-word " | ||
{{tag> | {{tag> | ||
+ |