routine Work : The System a point in time is automatically 's work
Execute only once to end dispatch: At, service is ATD
Cyclic execution of the work schedule: crontab, service for Crond
Common routine work
Journal rotation (log rotate)
Logging Analysis (log watch)
Update Database
Delete temporary files (tmpwatch)
Network-related service checks
At: Job scheduling performed once
1: Process of generating work
The AT command generates the work to run
Writes work as text to the /var/spool/at directory
Wait for ATD service to execute
2:at Work Scheduling rules
/etc/at.allow: Users written in this file can use the at
/etc/at.deny: does not exist/etc/at.allow when written in this file cannot be used at
When none of the two files are available, only root can use an at
3: Use
Start Service: ATD
At [-M to notify the completed work by email] [-c list work commands]
ATQ viewing work, atrm [job ' numbr Delete work]
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/CC/wKioL1WI4i-zsaGmAAEzPR3KpOs488.jpg "title=" 2015-06-22_10-53-55.png "alt=" Wkiol1wi4i-zsagmaaezpr3kpos488.jpg "/>
Cron: cyclic execution of routine work scheduling
1: Workflow
crontab command to generate the work to run
Writes work as text to the /var/spool/cron directory
Cron reads/var/spool/cron once per minute
Cron performs every job that is logged in the /var/log/cron log file (at No)
/etc/cron.allow and/etc/cron.deny (same as at)
2: Use
crontab [-e edit content] [-l view Content] [-R Delete all work] [-u Specify user edit]
Enter a text interface (actually executes the/usr/bin/crontab file)
* Any time
, with: * 3,4 * * * command three points and four points
-To: * 3-5 * * * Command three to five
/n per: */3 * * * * command every three minutes
*/5 * * * */home/boxin/test.sh //Every 5 minutes Execute command
1 1 * Mail my //Every January 1 23:59 send an e-mail to my
3: System configuration file:/etc/crontab
[Email protected] ~]# Cat/etc/crontab
Shell=/bin/bash
Path=/sbin:/bin:/usr/sbin:/usr/bin
Mailto=root//email to root when there is an error
home=/
# for details see Mans 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
4:anacron can wake up work tasks during downtime
is not a separate service, is a supplement to the crontab, during the shutdown period, unable to perform routine work, through the Anacron tool, you can detect during the shutdown during the outage need to do crontab tasks, and do
This article is from the "Call Me boxin" blog, so be sure to keep this source http://boxinknown.blog.51cto.com/10435935/1664419
Routine work scheduling at, Cron, Anacron