Sbinservicecrondstart start service sbinservicecrondstop disable service sbinservicecrondrestart restart service sbinservic
/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 the configuration
This service can be automatically started when the system is started:
Add:
/Sbin/service crond start
1. directly use the crontab command to edit
The cron service provides the crontab command to set the cron service. The following are some parameters and descriptions of this command:
Crontab-u // set a user's cron service. Generally, the root user needs this parameter when executing this command.
Crontab-l // list the details of a user's cron service
Crontab-r // delete the cron service of no user
Crontab-e // edit a user's cron service
For example, to view your cron settings as root:
Crontab-u root-l
For example, root wants to delete fred's cron settings:
Crontab-u fred-r
When editing the cron service, the edited content has some formats and conventions. enter:
Reference:Crontab-u root-e
In the vi editing mode, the edited content must conform to the following format:
*/1 ***** ls>/tmp/ls.txt
The first part of this format is the time setting, and the last part is the command to be executed. if there are too many commands to be executed, you can write these commands into a script, then you can directly call this script here. remember to write the complete path of the command during the call. We have a certain agreement on the time setting. the first five * numbers represent five numbers. the value range and meaning of the numbers are as follows:
Reference:
Minutes (0-59)
Hour (0-23)
Date (1-31)
Month (1-12)
Week (0-6) // 0 represents Sunday