linux system-level tasks and planned expansion anacrontab

The system is set up, clean common system junk or some script to automatically perform system tasks, generally we do understand on the line, do not change the configuration file is / etc / conrtab

 

SHELL: scheduled task is to run the interpreter, the default is bash

Environment variables to execute the command: PATH

MAILTO: Departure user who scheduled tasks

HOME: home directory is /

run-parts is a script in the / usr / bin / run-parts, the role is all the scripts / programs under implementation of a directory.

run-parts /etc/cron.hourly execute all scripts / programs under the directory /etc/cron.hourly/.

The following run-parts command is run

vim / etc / crontab difference timed run with crontab -e written?

vim / etc / crontab : system level is defined crontab, / etc / crontab owner and group are root

-e crontab : crontab is user-defined, all users can write

Both methods record position is not the same, an in / etc / further in / var / inside. Cron service calls are

If the system does not boot in the above said time how to do? Then this script does is not performed? Designers have long thought of this problem, so there is a cron service expansion, the purpose is to prevent non-computer 24 hours a missing guard task, anacrontab automatically after a specified time interval to miss: Extended File System is scheduled tasks mission

The format is like this:

period  delay  job-identifier  command

period - frequency command (days)

delay - delay Time (minutes)

job-identifier - description of the task, anacron used in the message and timestamp as the name of the job file, can contain any non-blank characters (except slashes).

command - command to execute

 

The first line means: every boot after 65 minutes cron.daily check whether a file is executed, and if not executed today on the implementation of his

The second line means: every 7 days after the boot is 70 minutes to check cron.weekly file is executed, and if not executed within a week of his execution

The third line means almost

Here to talk about the cron control services, and at the same, this is /etc/cron.deny configuration files to control, which is written to prohibit the use cron user name, a line on the OK

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11109425.html