Today, I want to regularly execute some scripts of ipvs, so I checked a crontab command on the Internet and recorded the usage of this command for future search. cron is a [daemon] used to execute a trip task within a specified time period. Every user has a crontab file to allow them to specify the content and time to be executed. In addition, the system also has a crontab that allows tasks with rules such as alternate logs and updating local data. Environment: Required tn12.10
Today, I want to regularly execute some scripts of ipvs, so I checked a crontab command on the Internet and recorded the usage of this command for future search.
Cron is a [daemon] used to execute a trip task within a specified time period. Every user has a crontab file to allow them to specify the content and time to be executed. In addition, the system also has a crontab that allows tasks with rules such as alternate logs and updating local data.
Environment: Medium tn 12.10
1. Use the crontab-e command
This command is simple and can be entered directly.
#: Crontab-e
The following window appears (the first time you will be prompted to use the compiler, you can just select one)
Then you can enter the content you want to execute.
For example, */2 ***** date>/home/postgres/time. log indicates the system time of course written to the time. log file every two minutes.
Then press ctrl + X to exit and save.
2. After saving crontab, restart the crontab service to make the task take effect.
Sudo service cron restart
3. Check the result.
Vim/home/postgres/time. log
Parameter description (I am looking for many examples to see it .)
# M h dom mon dow command
M minutes 0-59
H hour 0-23
Dow Day 1-31
Mon Month 1-12
Dow-week 1-6 0 indicates Sunday
Command is the command to be executed