Crond is a daemon that is used to periodically perform certain tasks or wait for certain events under Linux, similar to Scheduled tasks under Windows, when the operating system is installed, the Service tool is installed by default and the Crond process is started automatically. The Crond process periodically checks to see if there is a task to perform and automatically executes the task if there are tasks to perform.
The task scheduling under Linux is divided into two categories, system task scheduling and user task scheduling.
System task scheduling: The work to be performed by the system periodically, such as writing cache data to hard disk, log cleanup, etc. In the/etc directory there is a crontab file, this is the System Task Scheduler configuration file.
Service Crond start//Start Services service Crond stop//Shutdown Services Service Crond restart//Restart Services service Crond reload//Reload configuration View crontab Service status: Service Crond Status Manual start crontab services: Crond start
The above 1-4 lines start, stop, restart the service, and reload the configuration, respectively.
To set cron to start automatically at boot time, add/sbin/service crond start in the/etc/rc.d/rc.local script
View current user's crontab, enter crontab -l
;
Edit Crontab, enter crontab -e
;
Delete Crontab, entercrontab -r
Add a task
CRONTAB-E 0 */1 * * * Command 0 */2 * * command
Whether the query task is added:
Crontab-l-U root #查看root用户 0 */1 * * Command 0 */2 * * command
Note: The task to be performed is to indicate the path, otherwise it will not work:
Basic format:
* * * * * command
Time-sharing Weekly command
The 1th column represents minutes 1~59 per minute with * or */1
The 2nd column represents the hour 1~23 (0 means 0 points)
The 3rd column represents the date 1~31
The 4th column represents the month 1~12
5th Column Identification Number Week 0~6 (0 = Sunday)
6th List of commands to run
9-centos timed task-not working-no path indicated!!!