1, a single user's scheduled tasks - (a single scheduled tasks, you can create a periodic task)
2, system-level scheduled tasks - (mostly periodic scheduled task)
A single scheduled tasks
Instruction: at
[root @ b ~] # at now + 1 minutes ----- compartment 1 minute to perform a broadcast call laoda!
at> wall laoda! ----- perform content
at> ----- ctrl + D to exit
the Job 2 AT Thu Jan 30 17:39:00 2020
[root @ b ~] # atq ----- see the a single task (see when the task is not executed)
1 Thu Jan 30 17:42:00 2020 A root
[root @ b ~] #
Broadcast the Message from root @ b (Thu Jan 30 17:39:00 2020):
laoda! ------ Run 1 minute
[root @ b ~] # atrm 1 ---- delete the task + task number
[root @ b ~] # ll / var / spool / at / ----- when the task is not performed ordinary generates the task file in the directory, if the task is not finished executing file
Total 0
drwx ------. 2 daemon daemon. 6 Jan 17:46 spool 30
[the root @ b ~] # at 55: 1 may 11 ---- specify the exact time
[root @ b ~] # vim /etc/at.deny ----- he refused to specify a user to perform a single task plan
RedHat
[b RedHat @ ~] $ at now + 1 minutes
You do not have permission to use at .
[Note: If after before rejecting the user to perform a single task plan, rejected by the user specified in the original plan is still able to perform. ]
Periodic scheduled tasks
crontab -e
[root @ b ~] # vim / etc / crontab ----- ----- example of information for all users of the system to take effect
the SHELL = / bin / the bash
the PATH = / sbin: / bin: / usr / sbin: / usr / bin
a MAILTO = the root
For details see man 4 crontabs
Example of job definition:
.---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12) OR jan,feb,mar,apr …
| | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * user-name command to be executed
[Root @ b ~] # crontab -e -u root - -------- commencement of the specified user (-e to the current user)
Timeshare weeks sun and the moon
- 12 * * * wall haha ------ 12 AM the day
- / 2 * * * wall haha ------ every 2 minutes
[root @ b ~] # crontab -l displays the task list
[root @ b ~] # crontab -r remove all periodic list of scheduled tasks
**
Scalability Task Scheduler
**