Crontab and Anacrontab analysis vi/etc/crontabSHELL/bin/bashPATH/sbin:/bin:/usr/sbin:/usr/binMAILTOrootHOME/www.2cto.com # Comment # Exampleofjobdefinition :#.
Crontab and Anacrontab analysis vi/etc/crontab SHELL =/bin/bashPATH =/sbin:/bin:/usr/sbin: /usr/binMAILTO = rootHOME =/www.2cto.com # 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 # | # *** command to be executed1-59 *** root ls/aaaa execute every minute ls/aaaa crontab the log file is located at/var/log /system-level scheduled tasks and their extensions anacrontab are the extension files for system scheduled tasks: when a task is automatically executed after a specified time interval is missed, this is a system task that has been set up to clear System garbage or automatically execute some scripts. generally, we just need to understand it, do not change the configuration file to/etc/anaconrtab #/etc/anacrontab: configuration file for anacron # See anacron (8) and anacrontab (5) for details. SHELL =/bin/sh PATH =/sbin:/bin:/usr/sbin:/usr/bin MAILTO = root www.2cto.com
##### The format is as follows: period (frequency. days) delay (latency, minutes) job-identifier command 1 65 cron. daily run-parts/etc/cron. daily 7 70 cron. weekly run-parts/etc/cron. weekly 30 75 cron. monthly run-parts/etc/cron. monthly SHELL: the interpreter for running a scheduled task. the default value is bash PATH: environment variable MAILTO for executing the command: HOME: the home directory is/run-parts, which is a script in/usr/bin/run-parts. it is used to execute all scripts/programs in a directory. Run-parts/etc/cron. hourly execution directory/etc/cron. all scripts/programs under hourly. run-parts: the first line of the running command indicates that cron is checked 65 minutes after the command is started every day. check whether the daily file is executed. if it is not executed today, execute the second line, which means to check cron for 70 minutes after the machine is started every seven days. whether the weekly file is executed. if it is not executed within one week, the log file is located at/var/spool/cron author bengda.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.