Crontab details

cron is a daemon that can be used to schedule the execution of recurring tasks based on a combination of time, date, month, and week.
cron assumes that the system is running continuously. If the system is not running when a task is scheduled, the task will not be executed.
To use the cron service, you must have the vixie-cron RPM package installed and the crond service must be running. To determine if the package is installed, use the rpm -q vixie-cron command.



 To determine if the service is running, use the /sbin/service crond status command.



Users other than root can use the crontab tool to configure cron tasks. All user-defined crontabs are kept in the /var/spool/cron directory and executed under the identity of the user who created them. To create a crontab project as a user, log in as the user, then type the crontab -e command to edit the user's crontab using the editor specified by the VISUAL or EDITOR environment variable. This file uses the same format as /etc/crontab. When changes to the crontab are saved, the crontab file is saved under the username and written to the file /var/spool/cron/username.



The cron daemon checks the /etc/crontab file, the etc/cron.d/ directory, and the /var/spool/cron directory for changes every minute. If changes are found, they are loaded into memory. This way, you don't have to restart the daemon when a crontab file is changed.

The /etc/cron.allow and /etc/cron.deny files are used to restrict the use of cron. Both formats of the usage control file are one user per line. Both files do not allow spaces. If the usage control file is modified, the cron daemon (crond) does not have to be restarted. The usage control file is read every time the user adds or removes a cron job.
The root user can always use cron, regardless of what is specified in the usage control file.
If the cron.allow file exists, only the users listed in it are allowed to use cron, and the cron.deny file is ignored.
If the cron.allow file does not exist, all users listed in cron.deny are prohibited from using cron.

Since Cron is a built-in service of Linux, you can use the following methods to start and stop this service:
/sbin/service crond start //Start the service
/sbin/service crond stop //Close the service
/sbin/service crond restart //Restart the service
/ sbin/service crond reload //Reload configuration        

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326775664&siteId=291194637