[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 revision | ||
howtos:general_admin:task_scheduling [2015/06/24 14:39 (UTC)] – Added section on Interactive at (cmd) tdrssb | howtos:general_admin:task_scheduling [2015/06/24 19:36 (UTC)] (current) – tdrssb | ||
---|---|---|---|
Line 17: | Line 17: | ||
</ | </ | ||
- | ======Interactive 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 " | 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 " | ||
Line 27: | Line 27: | ||
job 4 at 2015-06-22 12:01 | job 4 at 2015-06-22 12:01 | ||
darkstar: | darkstar: | ||
+ | </ | ||
+ | |||
+ | =====File-driven at===== | ||
+ | Commands can also be contained within a file and run by **//at//**: | ||
+ | < | ||
+ | darkstar:~% at 12:32 -m -f / | ||
+ | warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh | ||
+ | job 8 at 2015-06-22 12:10 | ||
+ | </ | ||
+ | The **-m** flag will email the user after completion of the command; the **-f** flag specifies the command will read the job from a file, not from standard input. After the command is typed in (and the appropriate warning is displayed), the **//at//** job number((As distinct from a process ID (PID) known to the operating system)) is displayed. | ||
+ | |||
+ | =====at Internal Scheduling===== | ||
+ | The job numbers provided after a command is typed in, or when a file is read, allow the user to know which internal job will be run in sequential order. If a user wants to delete a specific task, all that needs to be known is this internal job number. To remove the job, the command **// | ||
+ | |||
+ | < | ||
+ | darkstar: | ||
+ | 7 2015-06-22 12:10 p tux | ||
+ | 8 2015-06-22 12:15 p root | ||
+ | </ | ||
+ | |||
+ | The command **//atq//** (**__at__ __q__ueue**) is the same as **//at -l//**: | ||
+ | |||
+ | < | ||
+ | darkstar: | ||
+ | 7 2015-06-22 12:10 p tux | ||
+ | 8 2015-06-22 12:15 p root | ||
+ | </ | ||
+ | |||
+ | To remove the user job, use **// | ||
+ | < | ||
+ | darkstar: | ||
+ | </ | ||
=====Using cron===== | =====Using cron===== | ||
Line 52: | Line 84: | ||
The //crontab// file syntax is: | The //crontab// file syntax is: | ||
- | minute(0-59) hour(0-23) day(1-31) | + | < |
+ | # * * * * * command to execute | ||
+ | # │ │ │ │ │ | ||
+ | # │ │ │ │ │ | ||
+ | # │ │ │ │ └───── day of week (0 - 6) (Sun(0) /Mon (1)/Tue (2)/Wed (3)/Thu (4)/Fri (5)/Sat (6)) | ||
+ | # │ │ │ └────────── month (1 - 12) | ||
+ | # │ │ └─────────────── | ||
+ | # │ └──────────────────── hour (0 - 23) | ||
+ | # └───────────────────────── min (0 - 59) | ||
+ | </ | ||
Using an asterisk in any placeholder location, will match any value. For example, the following will run // | Using an asterisk in any placeholder location, will match any value. For example, the following will run // | ||
Line 71: | Line 112: | ||
</ | </ | ||
- | + | **// | |
- | + | ||
- | < | + | |
- | The links in red are to non-existent articles. | + | |
- | + | ||
- | If you are experienced with those tools, please feel free to write the articles. | + | |
- | </note> | + | |
====== Sources ====== | ====== Sources ====== | ||
Line 85: | Line 120: | ||
* Originally written by [[wiki: | * Originally written by [[wiki: | ||
* Contrbutions by [[wiki: | * Contrbutions by [[wiki: | ||
+ | * Example crontab example modified from [[en.wikipedia.org/ | ||
<!-- 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> | ||